/* ミニロボバトル：構成主義（赤と黒・斜め・くさび）× モンドリアン（三原色と黒い線）× 工業製品（リベット・縞・計器） */
:root {
  --green: #2f6b4a;
  --paper: #ece4d2; --paper2: #f6f1e6; --ink: #1a1918; --red: #c8261b; --red-d: #9e1c13; --blue: #1c4c9c; --yellow: #eebf22;
  --steel: #8e918f; --mute: #4a4744; --line: 4px; --gap: 14px;
  --f-disp: "Dela Gothic One", "Zen Kaku Gothic New", sans-serif;
  --f-num: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --f-body: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); font-family: var(--f-body); -webkit-text-size-adjust: 100%; }
body { overscroll-behavior: none; touch-action: none; }
/* 文字は選べない・長押しのメニューも出さない（入力欄は除く） */
html, body, #ui, #ui * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: none; }
#ui > .modal, #ui > .result { pointer-events: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
.jp { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }

/* ---------------------------------------------------------------- 上の帯 */
#top { position: absolute; left: 0; right: 0; top: 0; height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; pointer-events: auto; z-index: 5; }
#top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--line); background: var(--ink); transform-origin: left; }
#top::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--paper) 92%, transparent); }
#top > * { position: relative; }
.logo { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; }
.logo-mark { width: 30px; height: 30px; background: var(--ink); position: relative; flex: none; overflow: hidden; }
.logo-mark::before { content: ""; position: absolute; left: -2px; top: 6px; border-left: 28px solid var(--red); border-top: 9px solid transparent; border-bottom: 9px solid transparent; animation: wedge 4s ease-in-out infinite; }
.logo-mark::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 9px; height: 9px; background: var(--yellow); }
@keyframes wedge { 0%,100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
.logo-t { font-family: var(--f-disp); font-size: 17px; letter-spacing: .02em; white-space: nowrap; }
.top-r { display: flex; align-items: center; gap: 8px; }
.chip, .credits { display: flex; align-items: baseline; gap: 6px; height: 34px; padding: 0 10px; border: 3px solid var(--ink); background: var(--paper2); }
.chip .k, .credits .k { font: 600 11px var(--f-mono); letter-spacing: .08em; }
.chip b { font: 900 22px/28px var(--f-num); }
.credits { background: var(--ink); color: var(--yellow); min-width: 118px; justify-content: space-between; }
.credits .k { color: var(--paper); }
.credits b { font: 900 24px/28px var(--f-num); font-variant-numeric: tabular-nums; }
.iconbtn { width: 34px; height: 34px; border: 3px solid var(--ink); background: var(--paper2); position: relative; padding: 0; }
.iconbtn i { position: absolute; inset: 7px; background: linear-gradient(90deg, var(--ink) 0 22%, transparent 22% 39%, var(--ink) 39% 61%, transparent 61% 78%, var(--ink) 78%); clip-path: polygon(0 60%, 22% 60%, 22% 20%, 39% 20%, 39% 0, 61% 0, 61% 30%, 78% 30%, 78% 50%, 100% 50%, 100% 100%, 0 100%); }
.iconbtn.off i { opacity: .25; }
.iconbtn.off::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 3px; background: var(--red); transform: rotate(-35deg); }

/* ---------------------------------------------------------------- 画面 */
#screen { position: absolute; inset: 58px 0 0 0; }
#screen.full { inset: 0; }
#screen .scr { pointer-events: none; }
#screen .scr * { pointer-events: auto; }
.scr { position: absolute; inset: 0; }

/* ボタン：板が押し込まれる */
.btn { --c: var(--ink); --t: var(--paper2); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  font: 900 17px/1 var(--f-body); letter-spacing: .04em; color: var(--t); background: var(--c); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  transition: transform .08s, box-shadow .08s; white-space: nowrap; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn.red { --c: var(--red); --t: #fff; }
.btn.blue { --c: var(--blue); --t: #fff; }
.btn.yellow { --c: var(--yellow); --t: var(--ink); }
.btn.paper { --c: var(--paper2); --t: var(--ink); }
.btn.big { min-height: 64px; font-size: 22px; padding: 0 30px; }
.btn.small { min-height: 38px; font-size: 14px; padding: 0 14px; box-shadow: 3px 3px 0 var(--ink); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .arrow { width: 18px; height: 14px; background: currentColor; clip-path: polygon(0 35%, 60% 35%, 60% 0, 100% 50%, 60% 100%, 60% 65%, 0 65%); }

/* パネル：黒い枠・角のリベット */
.panel { position: relative; background: var(--paper2); border: var(--line) solid var(--ink); }
.panel.rv::before, .panel.rv::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #d8dad8, #6f7270 70%); top: 5px; left: 5px; box-shadow: calc(100cqw - 22px) 0 0 0 #8e918f; }
.ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--ink); color: var(--paper2); font: 900 14px var(--f-body); letter-spacing: .06em; }
.ph .n { font: 900 20px var(--f-num); color: var(--yellow); }
.hz { height: 10px; background: repeating-linear-gradient(-45deg, var(--yellow) 0 10px, var(--ink) 10px 20px); background-size: 28.28px 28.28px; animation: hz 1.6s linear infinite; }
@keyframes hz { to { background-position: 28.28px 0; } }
.k { font: 600 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.num { font-family: var(--f-num); font-weight: 900; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 題名・最初の機体 */

.starter { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr; padding: 18px; gap: 12px; }
.starter-top { display: flex; justify-content: space-between; align-items: start; gap: 14px; }
.starter-h { background: var(--paper2); border: var(--line) solid var(--ink); padding: 10px 14px; max-width: 560px; }
.starter-go { flex: none; }
.starter-h h2 { margin: 0; font-family: var(--f-disp); font-weight: 400; font-size: clamp(26px, 4vw, 42px); }
.starter-h p { margin: 6px 0 0; font: 700 14px/1.6 var(--f-body); max-width: 40em; }
.starter-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; align-content: end; }
.scard { padding: 0; text-align: left; border: var(--line) solid var(--ink); background: var(--paper2); box-shadow: 6px 6px 0 var(--ink); transition: box-shadow .15s; display: flex; flex-direction: column; }
.scard:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); }
.scard.on { outline: 6px solid var(--yellow); outline-offset: 0; }
.scard .sh { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; color: #fff; font: 400 24px var(--f-disp); }
.scard.hv .sh { background: var(--red); }
.scard.lt .sh { background: var(--blue); }
.scard .sh .k { color: #fff; }
.scard .sb { padding: 10px 14px 14px; font: 700 14px/1.65 var(--f-body); }

/* ---------------------------------------------------------------- 題名：左（スマホは下）に文字とメニューの板、空いた所に機体を大きく */
/* 機体の名前の札（細い線で胸につなぐ） */

/* ---------------------------------------------------------------- 拠点（メニュー）：モンドリアンの格子 */
.hub { position: absolute; left: 18px; bottom: 18px; width: min(560px, calc(100% - 36px)); display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: 1.25fr 1fr; gap: 0; border: 6px solid var(--ink); background: var(--ink); height: min(400px, 56vh); }
.tile { --k: 1; --ms: 86%; --mx: 100%; --my: 100%; --gc: var(--ink); --tc: var(--paper2); --ic: var(--paper2); position: relative; overflow: hidden; border: 3px solid var(--ink); text-align: left; padding: 0; background: var(--paper2); }
/* シルエット：色の板をモデルの形で切り抜く。文字の切り抜き（.inv）と同じ値を使うので形がずれない */
.tile .g { position: absolute; inset: 0; background: var(--gc); -webkit-mask: var(--sil) var(--mx) var(--my) / calc(var(--ms) * var(--k)) auto no-repeat; mask: var(--sil) var(--mx) var(--my) / calc(var(--ms) * var(--k)) auto no-repeat; }
.tile .tx { position: absolute; inset: 0; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; color: var(--tc); pointer-events: none; z-index: 1; }
.tile .tx.inv { color: var(--ic); z-index: 2; -webkit-mask: var(--sil) var(--mx) var(--my) / calc(var(--ms) * var(--k)) auto no-repeat; mask: var(--sil) var(--mx) var(--my) / calc(var(--ms) * var(--k)) auto no-repeat; }
.tile .t { font: 400 clamp(22px, 3vw, 32px)/1.3 var(--f-disp); }
.tile .s { font: 700 13px/1.5 var(--f-body); max-width: 17em; }
/* 小さいタイルの説明文は左半分まで（右の絵と重ねない） */
.tile:not(.battle):not(.tut) .s { max-width: 52%; }
/* バトル：赤い地に黒い戦闘中のシルエット（文字は白。黒の上も白で読める） */
.tile.battle { background: var(--red); --gc: var(--ink); --tc: #fff; --ic: #fff; --ms: 124%; --mx: 46%; --my: 100%; grid-row: 1 / 3; }
/* 依頼：青い地に白いシルエット（白の上の文字は黒） */
.tile.mission { background: var(--blue); --gc: var(--paper2); --tc: #fff; --ic: var(--ink); --ms: 72%; --mx: 100%; --my: 100%; }
/* ガレージ：黄の地に黒いシルエット（黒の上の文字は白） */
.tile.garage { background: var(--yellow); --gc: var(--ink); --tc: var(--ink); --ic: var(--paper2); --ms: 40%; --mx: 97%; --my: 100%; }
/* ショップ：白の地に黒いシルエット（黒の上の文字は白） */
.tile.shop { background: var(--paper2); --gc: var(--ink); --tc: var(--ink); --ic: var(--paper2); --ms: 70%; --mx: 100%; --my: 100%; }
.tile .badge { position: absolute; right: 10px; top: 10px; z-index: 3; font: 900 13px var(--f-mono); background: var(--ink); color: var(--yellow); padding: 3px 7px; }
.hub-wrap { position: absolute; inset: 0; }
.hub.five { grid-template-columns: 1.35fr 1fr; grid-template-rows: repeat(6, 1fr) auto; height: min(500px, 66vh); }
/* 左の列はバトル（上）とフィールド（下）に分けた。右の3つは2段ずつ */
.hub.five .tile.battle { grid-column: 1; grid-row: 1 / 4; --ms: 84%; --mx: 60%; }
.hub.five .tile.field { grid-column: 1; grid-row: 4 / 7; }
.hub.five .tile.mission { grid-column: 2; grid-row: 1 / 3; }
.hub.five .tile.garage { grid-column: 2; grid-row: 3 / 5; }
.hub.five .tile.shop { grid-column: 2; grid-row: 5 / 7; }
.hub.five .tile.tut { grid-row: 7; }
.tile.field { background: var(--green, #2f6b4a); --gc: var(--paper2); --tc: #fff; --ic: var(--ink); --ms: 100%; --mx: 50%; --my: 100%; }

/* チュートリアル：拠点の下の段 */
.tile.tut { display: flex; grid-column: 1 / 3; grid-row: 4; background: var(--ink); color: var(--paper2); flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; padding: 10px 14px; }
.tile.tut .t { font-size: clamp(17px, 2.2vw, 22px); white-space: nowrap; flex: none; }
.tile.tut .s { max-width: none; }
.tile.tut .badge { background: var(--paper2); color: var(--ink); top: 50%; transform: translateY(-50%); }
/* 画面の下の案内の1行（Front Mission の作り） */
.guide-line { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; gap: 10px; align-items: center; min-height: 32px; padding: 4px 12px; background: color-mix(in srgb, var(--paper2) 92%, transparent); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--paper2), inset 0 0 0 3px rgba(26, 25, 24, .45); font: 700 13px/1.45 var(--f-body); }
#screen .guide-line, #screen .guide-line * { pointer-events: none; }
.guide-line .k { flex: none; background: var(--ink); color: var(--paper2); padding: 2px 6px; }

/* ---------------------------------------------------------------- 一覧つきの画面（ガレージ・ショップ・相手・依頼） */
.side { position: absolute; top: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.side.l { left: 12px; width: 300px; }
.side.r { right: 12px; width: 360px; }
.list { overflow: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; scrollbar-width: thin; }
.slots { display: grid; grid-template-columns: 1fr; gap: 0; }
.slot { display: grid; grid-template-columns: 74px 1fr; align-items: stretch; text-align: left; border: 0; border-bottom: 3px solid var(--ink); background: var(--paper2); padding: 0; min-height: 50px; }
.slot:last-child { border-bottom: 0; }
.slot .sk { display: flex; align-items: center; padding: 0 10px; background: var(--ink); color: var(--paper2); font: 900 13px var(--f-body); }
.slot .sn { display: flex; flex-direction: column; justify-content: center; padding: 4px 10px; font: 700 14px/1.3 var(--f-body); }
.slot .sn small { font: 600 11px var(--f-mono); color: var(--mute); }
.slot.on { background: var(--yellow); }
.slot.on .sk { background: var(--red); }
.slot:hover:not(.on) { background: #fff; }

.cat { display: flex; flex-direction: column; }
.pc { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: center; text-align: left; border: 0; border-bottom: 3px solid var(--ink); padding: 8px 10px; background: var(--paper2); position: relative; }
.pc:last-child { border-bottom: 0; }
.pc img { width: 76px; height: 76px; object-fit: contain; background: var(--paper); border: 2px solid var(--ink); }
.pc .pn { font: 900 15px/1.3 var(--f-body); }
.pc .pd { font: 500 12.5px/1.55 var(--f-body); margin-top: 3px; }
.pc .pt { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tag { font: 600 11px var(--f-mono); border: 2px solid var(--ink); padding: 1px 6px; background: var(--paper2); }
.tag.eq { background: var(--ink); color: var(--yellow); }
.tag.lock { background: var(--paper); color: var(--mute); border-color: var(--mute); }
.tag.price { background: var(--yellow); }
.pc.on { background: #fff; box-shadow: inset 8px 0 0 var(--red); }
.pc.locked .pn, .pc.locked img { opacity: .55; }
.pc:hover { background: #fff; }

.stats { padding: 10px 12px 12px; display: grid; gap: 7px; }
.stat { display: grid; grid-template-columns: 78px 1fr 54px; align-items: center; gap: 8px; font: 700 12.5px var(--f-body); }
.stat .bar { position: relative; height: 12px; background: var(--paper); border: 2px solid var(--ink); overflow: hidden; }
.stat .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); width: 0; }
.stat .bar u { position: absolute; top: 0; bottom: 0; text-decoration: none; }
.stat .bar u.up { background: var(--blue); }
.stat .bar u.dn { background: repeating-linear-gradient(-45deg, var(--red) 0 4px, #e46a5f 4px 8px); }
.stat .v { text-align: right; font: 900 17px var(--f-num); }
.stat .v.up { color: var(--blue); }
.stat .v.dn { color: var(--red); }
.weight { padding: 10px 12px; border-top: 3px solid var(--ink); }
.weight .wb { position: relative; height: 18px; border: 3px solid var(--ink); background: var(--paper); margin-top: 6px; }
.weight .wb i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }
.weight .wb .cap { position: absolute; top: -6px; bottom: -6px; width: 4px; background: var(--red); }
.weight.over .wb i { background: repeating-linear-gradient(-45deg, var(--red) 0 6px, var(--ink) 6px 12px); }
.warn { margin-top: 8px; font: 700 12.5px/1.5 var(--f-body); color: #fff; background: var(--red); padding: 6px 8px; }
.wpn { padding: 8px 12px 10px; border-top: 3px solid var(--ink); font: 700 12.5px/1.6 var(--f-body); }
.wpn b { font-family: var(--f-num); font-size: 16px; }

.bottom-bar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 12px; }
.seg { display: inline-flex; border: 3px solid var(--ink); background: var(--paper2); }
.seg button { border: 0; border-right: 3px solid var(--ink); background: none; padding: 0 14px; min-height: 40px; font: 900 13px var(--f-body); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--yellow); }

/* ステッカー */
.stk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 3px solid var(--ink); }
.stk { aspect-ratio: 1; border: 0; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); background: var(--paper) center/70% no-repeat; padding: 0; position: relative; }
.stk:nth-child(4n) { border-right: 0; }
.stk.on { background-color: var(--yellow); box-shadow: inset 0 0 0 4px var(--red); }
.stk.add { display: flex; align-items: center; justify-content: center; font: 900 12px/1.3 var(--f-body); background: var(--ink); color: var(--paper2); text-align: center; padding: 4px; }
.stk .x { position: absolute; right: 2px; top: 2px; width: 20px; height: 20px; border: 2px solid var(--ink); background: var(--paper2); font: 900 12px/14px var(--f-mono); padding: 0; }
.ctl { padding: 10px 12px; display: grid; gap: 8px; border-top: 3px solid var(--ink); }
.ctl label { display: grid; grid-template-columns: 54px 1fr 40px; align-items: center; gap: 8px; font: 700 12.5px var(--f-body); }
.ctl input[type=range] { width: 100%; accent-color: var(--red); }
.ctl .row { display: flex; gap: 8px; flex-wrap: wrap; }
.note { padding: 8px 12px; font: 500 12.5px/1.6 var(--f-body); }

/* 相手・依頼のカード */
.ladder { position: absolute; left: 12px; right: 12px; top: 12px; bottom: 12px; display: grid; grid-template-columns: 300px 1fr; gap: 14px; }
.cls-col { display: flex; flex-direction: column; gap: 0; border: var(--line) solid var(--ink); background: var(--ink); align-self: start; }
.cls-row { display: grid; grid-template-columns: 54px 1fr; border: 0; border-bottom: 3px solid var(--ink); background: var(--paper2); text-align: left; padding: 0; min-height: 56px; }
.cls-row:last-child { border-bottom: 0; }
.cls-row .ck { display: flex; align-items: center; justify-content: center; font: 900 30px var(--f-num); background: var(--ink); color: var(--paper2); }
.cls-row .cd { padding: 8px 10px; font: 700 12.5px/1.5 var(--f-body); }
.cls-row.on { background: var(--yellow); }
.cls-row.on .ck { background: var(--red); color: #fff; }
.cls-row.locked { opacity: .5; }
.opp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-content: start; overflow: auto; padding: 4px 8px 12px 4px; }
.opp { text-align: left; padding: 0; border: var(--line) solid var(--ink); background: var(--paper2); box-shadow: 5px 5px 0 var(--ink); display: flex; flex-direction: column; transition: box-shadow .12s; }
.opp:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.opp .oh { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: var(--ink); color: var(--paper2); }
.opp .oh b { font: 400 19px var(--f-disp); }
.opp img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper); border-bottom: 3px solid var(--ink); display: block; }
.opp .ob { padding: 8px 10px 10px; font: 700 13px/1.55 var(--f-body); flex: 1; }
.opp .of { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-top: 3px solid var(--ink); }
.opp .of .num { font-size: 22px; }
.opp.won .oh { background: var(--blue); }
.stamp { position: absolute; right: 8px; top: 44px; font: 400 18px var(--f-disp); color: var(--red); border: 4px solid var(--red); padding: 2px 8px; transform: rotate(-12deg); background: color-mix(in srgb, var(--paper2) 80%, transparent); }

.board { position: absolute; inset: 12px; display: flex; flex-direction: column; gap: 12px; }
.board-h { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.board-h h2, .ladder h2 { margin: 0; font: 400 clamp(24px, 3.4vw, 36px) var(--f-disp); }
.mis-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; overflow: auto; padding: 4px 8px 14px 4px; align-content: start; }
.mis { text-align: left; padding: 0; border: var(--line) solid var(--ink); background: var(--paper2); box-shadow: 5px 5px 0 var(--ink); position: relative; transition: box-shadow .12s; display: flex; flex-direction: column; }
.mis:nth-child(3n+1) { transform: rotate(-.6deg); }
.mis:nth-child(3n+2) { transform: rotate(.5deg); }
.mis:hover { transform: translate(-2px, -3px) rotate(0); box-shadow: 8px 8px 0 var(--ink); }
.mis .mh { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px; border-bottom: 3px solid var(--ink); }
.mis .mh .cl { font: 600 11px var(--f-mono); }
.mis .mh b { display: block; font: 400 20px/1.25 var(--f-disp); margin-top: 3px; }
.mis .ic { width: 46px; height: 46px; }
.mis .mb { padding: 10px 12px; font: 700 13px/1.6 var(--f-body); flex: 1; }
.mis .mf { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-top: 3px solid var(--ink); gap: 10px; }
.diff { display: inline-flex; gap: 3px; }
.diff i { width: 12px; height: 16px; border: 2px solid var(--ink); background: var(--paper); transform: skewX(-12deg); }
.diff i.on { background: var(--red); }
.mis .rw { font: 900 24px var(--f-num); }
.mis.done .mh { background: var(--yellow); }

/* 説明の窓（依頼の打ち合わせ・結果） */
.modal { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(26, 25, 24, .45); pointer-events: auto; z-index: 8; padding: 16px; }
.mbox { width: min(620px, 100%); max-height: calc(100% - 20px); overflow: auto; background: var(--paper2); border: 6px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); }
.mbox .mt { padding: 14px 16px; background: var(--blue); color: #fff; }
.mbox .mt.red { background: var(--red); }
.mbox .mt .cl { font: 600 12px var(--f-mono); color: #fff; }
.mbox .mt h3 { margin: 4px 0 0; font: 400 clamp(22px, 3.2vw, 30px)/1.25 var(--f-disp); }
.mbox .mc { padding: 16px; font: 700 15px/1.8 var(--f-body); }
.mbox .goal { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); background: var(--yellow); font: 900 15px/1.4 var(--f-body); }
.mbox .goal .k { background: var(--ink); color: var(--yellow); padding: 3px 7px; }
.mbox .ma { display: flex; gap: 12px; justify-content: flex-end; padding: 14px 16px; flex-wrap: wrap; }

/* 結果 */
.result { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(236, 228, 210, .55); pointer-events: auto; z-index: 8; padding: 16px; }
.rbox { position: relative; width: min(640px, 100%); background: var(--paper2); border: 6px solid var(--ink); box-shadow: 12px 12px 0 var(--ink); overflow: hidden; }
.rbig { position: relative; height: 150px; overflow: hidden; background: var(--ink); }
.rbig .w { position: absolute; left: -10%; top: 0; bottom: 0; width: 80%; background: var(--red); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.rbig.lose .w { background: var(--blue); }
.rbig h2 { position: absolute; right: 22px; bottom: 6px; margin: 0; color: var(--paper2); font: 400 clamp(54px, 11vw, 96px)/1 var(--f-disp); }
.rrows { padding: 12px 16px; display: grid; gap: 6px; }
.rrow { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px dashed var(--steel); padding: 4px 0; font: 700 14px var(--f-body); }
.rrow .num { font-size: 22px; }
.rrow.total { border-bottom: 0; border-top: 4px solid var(--ink); padding-top: 8px; }
.rrow.total .num { font-size: 38px; color: var(--red); }
.rnote { padding: 0 16px 6px; font: 700 13px/1.6 var(--f-body); }
.ract { display: flex; justify-content: flex-end; gap: 12px; padding: 12px 16px 16px; flex-wrap: wrap; }

/* VS の画面 */
.vs { position: absolute; inset: 0; z-index: 9; pointer-events: none; overflow: hidden; }
.vs .a, .vs .b { position: absolute; top: 0; bottom: 0; width: 64%; display: flex; flex-direction: column; justify-content: center; padding: 0 6%; color: #fff; }
.vs .a { left: 0; background: var(--red); clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%); }
.vs .b { right: 0; background: var(--blue); clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%); align-items: flex-end; text-align: right; }
.vs .k { color: #fff; font-size: 13px; }
.vs .nm { font: 400 clamp(30px, 6vw, 64px)/1.05 var(--f-disp); }
.vs .mid { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 900 clamp(80px, 16vw, 180px)/1 var(--f-num); color: var(--yellow); -webkit-text-stroke: 6px var(--ink); paint-order: stroke; }
.count { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font: 900 clamp(110px, 22vw, 220px)/1 var(--f-num); color: var(--ink); -webkit-text-stroke: 4px var(--paper2); paint-order: stroke; z-index: 9; pointer-events: none; }
.count.go { font: 400 clamp(60px, 12vw, 120px)/1 var(--f-disp); color: var(--red); }

/* ---------------------------------------------------------------- 試合中の表示（Front Mission Alternative の作り：暗い半透明の板・薄い2重線・短い英字の符号）
   元の色は暗い地にオレンジ系だが、黒×オレンジは使わない決まりなので、線と文字は生成り、敵と損傷は赤、EN は青にした */
/* 寄せすぎない：板は今の紙色と黒い線のまま、作り（区切り箱・2重線・英字の符号・レーダー・部位の表）だけを借りる */
#hud { position: absolute; inset: 0; --fm: rgba(246, 241, 230, .9); --fl: #1a1918; --ft: #1a1918; --fg: rgba(26, 25, 24, .14); }
.fm-top, .fm-box, .fm-guide { color: var(--ft); background: var(--fm); border: 2px solid var(--fl); box-shadow: inset 0 0 0 2px var(--fm), inset 0 0 0 3px rgba(26, 25, 24, .45); }
.fm-top { position: absolute; left: 10px; right: 10px; top: 8px; display: grid; grid-template-columns: 26px minmax(0, 1.25fr) auto minmax(0, 1fr) 26px; align-items: stretch; }
.fm-tab { display: grid; place-items: center; font: 600 11px var(--f-mono); background: var(--ink); color: var(--paper2); margin: 4px; }
.fm-seg { padding: 5px 10px 6px; border-left: 1px solid var(--fl); min-width: 0; }
.fm-seg:nth-child(2) { border-left: 0; }
.fm-k { display: flex; align-items: baseline; gap: 8px; font: 600 11px var(--f-mono); letter-spacing: .08em; white-space: nowrap; overflow: hidden; }
.fm-k b { font: 700 13px var(--f-body); letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; }
.fm-k .num { margin-left: auto; font-size: 22px; line-height: 1; letter-spacing: 0; }
.fm-bar { position: relative; height: 9px; margin-top: 5px; border: 1px solid var(--fl); background: var(--paper); }
.fm-bar i { position: absolute; left: 0; top: 1px; bottom: 1px; background: var(--ft); transition: width .12s; z-index: 1; }
.fm-bar b { position: absolute; left: 0; top: 1px; bottom: 1px; background: var(--red); transition: width .6s .25s; }
.fm-bar.enemy i { background: var(--red); }
.fm-bar.enemy b { background: var(--ft); opacity: .35; }
.en { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; height: 7px; margin-top: 5px; }
.en i { background: var(--paper); border: 1px solid rgba(26, 25, 24, .35); }
.en i.on { background: var(--blue); border-color: var(--blue); }
.en.heat i.on { background: var(--red); border-color: var(--red); }
.fm-seg.time { text-align: center; min-width: 92px; }
.timer { font: 900 34px/1 var(--f-num); font-variant-numeric: tabular-nums; margin-top: 2px; }
.timer.low { color: #fff; background: var(--red); }
.obj { margin-top: 4px; font: 700 12px/1.4 var(--f-body); color: var(--ft); }
.fm-h { display: flex; justify-content: space-between; gap: 8px; font: 600 10.5px var(--f-mono); letter-spacing: .1em; padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1px solid rgba(26, 25, 24, .45); }
.fm-h b { font: 600 10.5px var(--f-mono); }
.fm-box { position: relative; padding: 6px 8px 8px; }
.fm-bl { position: absolute; left: 10px; bottom: 44px; display: flex; gap: 8px; align-items: end; }
.radar canvas { display: block; width: 150px; height: 150px; }
.dmgmap { width: 190px; }
.dmgmap .pr { display: grid; grid-template-columns: 48px 44px 1fr; gap: 6px; align-items: center; font: 600 10.5px var(--f-mono); height: 17px; }
.dmgmap .pcode { opacity: .75; }
.dmgmap .pb { height: 7px; border: 1px solid var(--fl); position: relative; }
.dmgmap .pb i { position: absolute; left: 0; top: 1px; bottom: 1px; background: var(--ft); transition: width .2s; }
.dmgmap .pr.low .pb i { background: var(--red); }
.dmgmap .pr.gone .pk { color: var(--red); text-decoration: line-through; }
.hud-br { position: absolute; right: 10px; bottom: 44px; display: flex; gap: 8px; align-items: end; }
.wbox { min-width: 150px; }
.wbox .wv, .wbox .sv { font: 900 17px/1.2 var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: clip; }
.wbox .ws, .wbox .ss { font: 700 11px/1.35 var(--f-body); white-space: nowrap; }
.wbox .rl { height: 5px; border: 1px solid var(--fl); margin-top: 4px; }
.wbox .rl i { display: block; height: 100%; background: var(--ft); width: 0; }
.fm-guide { position: absolute; left: 10px; right: 10px; bottom: 8px; padding: 5px 12px; font: 700 12px/1.5 var(--f-body); text-align: center; }
/* 狙い：角括弧と、上に浮く札 */
.ret { position: absolute; left: 0; top: 0; width: 56px; height: 56px; margin: -28px 0 0 -28px; pointer-events: none; will-change: transform; }
.ret > i { position: absolute; width: 14px; height: 14px; border: 3px solid var(--red); }
.ret > i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.ret > i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.ret > i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.ret > i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.ret.far > i { border-color: var(--ink); opacity: .7; }
.ret .tag { position: absolute; left: calc(100% + 8px); bottom: 70%; min-width: 108px; padding: 3px 6px 4px; color: var(--ft); background: var(--fm); border: 1px solid var(--fl); font: 600 10.5px var(--f-mono); }
.ret .tag::before { content: ""; position: absolute; right: 100%; bottom: -6px; width: 9px; height: 1px; background: var(--fl); transform: rotate(-35deg); transform-origin: right; }
.ret .tn { display: block; font: 700 12px var(--f-body); white-space: nowrap; }
.ret .td { font: 900 14px var(--f-num); }
.ret .tp { display: flex; gap: 2px; margin-top: 3px; }
.ret .tp i { flex: 1; height: 4px; border: 1px solid var(--fl); position: relative; }
.ret .tp u { position: absolute; left: 0; top: 0; bottom: 0; background: var(--red); text-decoration: none; }
.dmg { position: absolute; left: 0; top: 0; font: 900 26px var(--f-num); color: var(--ink); -webkit-text-stroke: 4px var(--paper2); paint-order: stroke; pointer-events: none; white-space: nowrap; will-change: transform, opacity; }
.dmg.big { font-size: 40px; color: var(--red); }
.dmg.g { color: var(--blue); }
.dmg.me { color: var(--red); }
/* 知らせ：Front Mission の会話の窓の作り */
.callout { position: absolute; left: 50%; top: 26%; transform: translate(-50%, -50%); font: 400 clamp(24px, 4.4vw, 40px) var(--f-disp); color: var(--paper2); background: var(--ink); padding: 6px 20px; pointer-events: none; white-space: nowrap; box-shadow: 6px 6px 0 rgba(26, 25, 24, .25); }
.callout.red { background: var(--red); }
.flashv { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 0 var(--red); }
.pausebtn { pointer-events: auto; position: absolute; right: 10px; top: 76px; z-index: 5; }

/* チュートリアルの窓 */
.tutwin { position: absolute; left: 50%; top: 82px; transform: translateX(-50%); width: min(540px, calc(100% - 20px)); padding: 8px 12px 10px; pointer-events: auto; }
.tutwin .tt { font: 400 clamp(20px, 2.6vw, 26px)/1.3 var(--f-disp); margin: 2px 0 4px; }
.tutwin .tb { font: 700 14px/1.65 var(--f-body); min-height: 2.6em; }
.tutwin .tk { display: flex; gap: 8px; align-items: baseline; margin-top: 6px; font: 700 13px/1.5 var(--f-body); }
.tutwin .tk .k { flex: none; background: var(--ink); color: var(--paper2); padding: 1px 6px; }
.tutwin .tp { height: 8px; border: 2px solid var(--ink); margin-top: 8px; }
.tutwin .tp i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .15s; }
.tutwin .tskip { position: absolute; right: 10px; top: 30px; }
.tut-ok { position: absolute; right: 20px; top: 40%; font: 400 26px var(--f-disp); color: var(--red); border: 4px solid var(--red); padding: 2px 10px; background: var(--paper2); pointer-events: none; }
#hud.tutorial.touch .fm-bl { display: none; }
.pad.tgt { right: 172px; bottom: 150px; width: 54px; height: 54px; font-size: 12px; }
.pad.view { right: 64px; bottom: 196px; width: 54px; height: 54px; font-size: 12px; background: var(--ink); color: var(--paper2); }
/* スマホを横向きで持った時：上の帯・レーダー・練習の窓を小さく、ボタンは右下に収める */
@media (pointer: coarse) and (max-height: 500px) {
  .fm-top { top: 4px; left: 6px; right: 6px; }
  .fm-seg { padding: 3px 8px 4px; }
  .fm-k .num { font-size: 16px; }
  .timer { font-size: 24px; }
  .en { height: 5px; margin-top: 3px; }
  .fm-bar { height: 7px; margin-top: 3px; }
  #hud.touch .fm-bl { top: 62px; }
  #hud.touch .radar canvas { width: 84px; height: 84px; }
  .tutwin { top: 60px; width: min(440px, 48vw); left: auto; right: 10px; transform: none; padding: 6px 10px 8px; }
  .tutwin .tt { font-size: 18px; } .tutwin .tb { font-size: 12px; min-height: 0; }
  #touch .pads { transform: scale(.86); transform-origin: right bottom; }
  #touch .ghost { bottom: 14%; }
  .pausebtn { top: 62px !important; right: auto; left: 104px; }
  #hud .xbtn.xbtn { top: 62px; right: auto; left: 176px; }
}

/* スマホの操作（指の時は右下の武器の表示と操作の説明を出さない：ボタンに出す） */
#hud.touch .hud-br, #hud.touch .fm-guide, #hud.touch .dmgmap { display: none; }
#hud.touch .fm-bl { left: 10px; top: 92px; bottom: auto; }
#hud.touch .radar canvas { width: 104px; height: 104px; }
#touch { position: absolute; inset: 0; }
#touch .camzone { position: absolute; inset: 0; pointer-events: auto; }
#touch .camhint { position: absolute; right: 18%; top: 38%; font: 900 14px var(--f-body); color: var(--ink); background: color-mix(in srgb, var(--paper2) 80%, transparent); border: 2px solid var(--ink); padding: 4px 10px; pointer-events: none; }
#touch .stick { position: absolute; left: 0; bottom: 0; width: 50%; height: 62%; pointer-events: auto; }
#touch .ghost { position: absolute; left: 22%; bottom: calc(16% + var(--safe-b)); width: 112px; height: 112px; margin-left: -56px; border: 3px dashed rgba(26, 25, 24, .55); border-radius: 50%; display: grid; place-items: center; transition: opacity .15s; pointer-events: none; }
#touch .ghost i { width: 44px; height: 44px; border-radius: 50%; background: rgba(26, 25, 24, .35); }
#touch .ghost span { position: absolute; bottom: -24px; font: 900 13px var(--f-body); color: var(--ink); background: color-mix(in srgb, var(--paper2) 80%, transparent); padding: 0 6px; }
#touch .knob { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border: 4px solid var(--ink); border-radius: 50%; background: color-mix(in srgb, var(--paper2) 45%, transparent); display: none; }
#touch .knob i { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; background: var(--ink); }
#touch .pads { position: absolute; right: 12px; bottom: calc(12px + var(--safe-b)); width: 210px; height: 210px; pointer-events: none; }
.pad { position: absolute; border: 4px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font: 900 14px var(--f-body); pointer-events: auto; user-select: none; -webkit-user-select: none; color: var(--ink); background: color-mix(in srgb, var(--paper2) 80%, transparent); overflow: hidden; }
.pad.fire { right: 0; bottom: 0; width: 104px; height: 104px; background: var(--red); color: #fff; font-size: 17px; }
.pad.sub { right: 112px; bottom: 6px; width: 74px; height: 74px; background: var(--blue); color: #fff; }
.pad.dash { right: 4px; bottom: 114px; width: 74px; height: 74px; background: var(--yellow); }
.pad.jump { right: 100px; bottom: 96px; width: 66px; height: 66px; }
.pad.mode { right: 178px; bottom: 88px; width: 54px; height: 54px; font-size: 12px; background: var(--ink); color: var(--paper2); }
.pad.on { filter: brightness(.8); transform: scale(.94); }
.pad .cd { position: absolute; inset: 0; background: rgba(26, 25, 24, .55); transform-origin: bottom; transform: scaleY(0); }
.pad span { position: relative; }
.tbtn { position: absolute; top: 74px; right: 12px; pointer-events: auto; }

/* ---------------------------------------------------------------- 画面の切り替え（斜めの板が横切る） */
#wipe { position: absolute; inset: 0; z-index: 20; pointer-events: none; overflow: hidden; }
#wipe i { position: absolute; top: -20%; bottom: -20%; width: 170%; left: -35%; transform: translateX(-200%); }
#wipe .w1 { background: var(--ink); }
#wipe .w2 { background: var(--red); }
#wipe .w3 { background: var(--yellow); }
#toast { position: absolute; right: 12px; top: 70px; display: flex; flex-direction: column; gap: 8px; z-index: 15; align-items: end; }
.toast { pointer-events: none; background: var(--ink); color: var(--paper2); font: 700 14px/1.5 var(--f-body); padding: 10px 14px 10px 22px; border: 3px solid var(--ink); max-width: min(380px, calc(100vw - 24px)); position: relative; }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: repeating-linear-gradient(-45deg, var(--yellow) 0 6px, var(--ink) 6px 12px); }
#boot { position: absolute; inset: 0; display: grid; place-items: center; background: var(--paper); z-index: 30; }
.boot-bar { width: min(320px, 70vw); height: 18px; border: 4px solid var(--ink); }
.boot-bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }

/* ---------------------------------------------------------------- 画面の幅ごと */
@media (max-width: 1080px) {
  .side.r { width: 330px; }
  .side.l { width: 250px; }
  .opp-grid, .mis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  #top { height: 52px; padding: 0 10px; }
  #screen { top: 52px; }
  .logo-t { font-size: 14px; }
  .credits { min-width: 96px; }
  .chip, .credits, .iconbtn { height: 32px; }
  /* ガレージ・ショップ：上に機体、下に一覧 */
  .side.l { left: 8px; right: 8px; top: auto; bottom: auto; width: auto; position: absolute; }
  .side.r { left: 8px; right: 8px; width: auto; top: 44%; bottom: 62px; }
  .tutwin { top: 72px; }
  .tutwin .tb { font-size: 12.5px; }
  .hub.five { height: auto; grid-template-rows: repeat(6, minmax(62px, auto)) auto; }
  .garage .side.l { top: 8px; }
  .slots.compact { grid-template-columns: repeat(4, 1fr); }
  .slots.compact .slot { grid-template-columns: 1fr; border-bottom: 0; border-right: 3px solid var(--ink); min-height: 40px; }
  .slots.compact .slot:nth-child(4n) { border-right: 0; }
  .slots.compact .slot:nth-child(-n+4) { border-bottom: 3px solid var(--ink); }
  .slots.compact .slot .sk { justify-content: center; padding: 0 2px; font-size: 12px; text-align: center; }
  .slots.compact .slot .sn { display: none; }
  .ladder { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .cls-col { flex-direction: row; }
  .cls-row { flex: 1; grid-template-columns: 1fr; border-bottom: 0; border-right: 3px solid var(--ink); min-height: 0; }
  .cls-row:last-child { border-right: 0; }
  .cls-row .cd { display: none; }
  .cls-row .ck { font-size: 24px; padding: 4px 0; }
  .hub { height: min(360px, 50vh); }
  .starter-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .scard .sb { font-size: 12.5px; }
  .scard .sh { font-size: 19px; }
}
@media (max-width: 560px) {
  .opp-grid, .mis-grid { grid-template-columns: 1fr; }
  .fm-top { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); left: 6px; right: 6px; top: 6px; }
  .fm-tab { display: none; }
  .fm-seg { padding: 4px 6px 5px; }
  .fm-k { font-size: 9.5px; gap: 4px; }
  .fm-k b { font-size: 11px; }
  .fm-k .num { font-size: 16px; }
  .timer { font-size: 26px; }
  .fm-seg.time { min-width: 52px; }
  .obj { font-size: 10.5px; }
  .pausebtn { top: 46%; }
  #hud .xbtn.xbtn { top: calc(46% + 50px); }
  .hud-br { display: none; }
  .starter-cards { grid-template-columns: 1fr; gap: 8px; }
  .starter-top { flex-direction: column; align-items: stretch; }
  .starter-h { padding: 8px 10px; }
  .starter-h p { font-size: 12.5px; }
  .starter-go .btn { width: 100%; min-height: 52px; font-size: 18px; }
  .starter { padding: 10px; gap: 8px; }
  .scard .stats { padding: 6px 10px 8px; gap: 4px; }
  .tile:not(.battle) .s { display: none; }
  .hub.five { grid-template-rows: repeat(6, minmax(40px, auto)) auto; }
  .tile .t { font-size: 22px; }
  .scard .sb { display: none; }
    .logo-t { display: none; }
  .stat { grid-template-columns: 66px 1fr 48px; }
  .vs .a, .vs .b { width: 72%; }
}
@media (prefers-reduced-motion: reduce) {
  .hz, .logo-mark::before, .ret .rot { animation: none; }
}
@media (max-width: 360px) {
  .tile .t { font-size: 18px; white-space: nowrap; }
  /* 試合の上の帯：名前は1段下に回して切らない */
  .fm-k { flex-wrap: wrap; row-gap: 0; }
  .fm-k b { order: 3; flex: 1 0 100%; white-space: nowrap; overflow: visible; }
  .tile { padding: 10px; }
}
/* 高さの低い画面（スマホの横持ちなど）：メニューと窓を詰める */
@media (max-height: 520px) {
  #top { height: 44px; }
  #screen { top: 44px; }
  .chip, .credits, .iconbtn { height: 30px; }
  #screen .side { bottom: 8px; top: 8px; }
  .ladder, .board { bottom: 8px; top: 8px; }
  .hub { bottom: 10px; }
  .hub.five { height: calc(100% - 20px); grid-template-rows: repeat(6, 1fr) auto; }
  .tile .s { display: none; }
  .tile.tut .s { display: block; }
  .opp img { aspect-ratio: 16 / 7; }
  .opp .ob { display: none; }
  .mis .mb { display: none; }
  .cls-row { min-height: 44px; }
  .cls-row .cd { font-size: 11.5px; padding: 4px 8px; }
  .mbox .mt { padding: 8px 12px; }
  .mbox .mc { padding: 8px 12px; font-size: 13px; line-height: 1.6; }
  .mbox .stats { display: none; }
  .mbox .ma { padding: 8px 12px; }
  .mbox .goal { padding: 6px 12px; font-size: 13px; }
  .rbig { height: 90px; }
  .rbig h2 { font-size: 56px; }
  .rrows { padding: 6px 12px; gap: 2px; }
  .rrow { font-size: 12.5px; padding: 2px 0; }
  .rrow.total .num { font-size: 28px; }
}

/* ---------------------------------------------------------------- ドック（ガレージ・ショップ）
   機体を一番大きく見せる。操作は1枚の板（パソコンは右、スマホは下）にまとめ、機体の上には何も置かない */
.dk-float { position: absolute; left: 14px; top: 12px; display: flex; gap: 10px; align-items: center; }
.dk-title { font: 400 22px var(--f-disp); background: var(--ink); color: var(--paper2); padding: 4px 14px; }
.dk-panel { position: absolute; right: 12px; top: 12px; bottom: 12px; width: 404px; display: flex; flex-direction: column; background: var(--paper2); border: var(--line) solid var(--ink); box-shadow: 8px 8px 0 var(--ink); overflow: hidden; }
.dk-slots { flex: none; display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); border-bottom: 3px solid var(--ink); background: var(--ink); gap: 3px; }
.dks { border: 0; padding: 6px 2px 5px; background: var(--paper2); display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 48px; min-width: 0; }
.dks b { font: 900 12px/1.15 var(--f-body); word-break: keep-all; text-align: center; }
.dks small { font: 600 10.5px var(--f-mono); color: var(--mute); white-space: nowrap; }
.dks.on { background: var(--red); color: #fff; }
.dks.on small { color: #fff; }
.dks:hover:not(.on) { background: #fff; }
.dk-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.dk-list { flex: none; display: flex; gap: 0; overflow-x: auto; overscroll-behavior: contain; border-bottom: 3px solid var(--ink); scrollbar-width: thin; }
.dkc { flex: 0 0 132px; border: 0; border-right: 3px solid var(--ink); padding: 8px 8px 10px; background: var(--paper2); display: grid; justify-items: center; gap: 4px; position: relative; }
.dkc img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--paper); border: 2px solid var(--ink); }
.dkc .nm { font: 900 12.5px/1.3 var(--f-body); text-align: center; }
.dkc .tag { font-size: 10.5px; }
.dkc.eq { box-shadow: inset 0 -6px 0 var(--ink); }
.dkc.on { background: #fff; box-shadow: inset 0 0 0 5px var(--red); }
.dkc:hover:not(.on) { background: #fff; }
.dk-stats .stats { padding: 10px 12px 8px; gap: 6px; }
.dk-stats .weight { padding: 8px 12px 10px; }
.stat.cmp { grid-template-columns: 70px 1fr 46px 40px; }
.stat .d { font: 900 14px var(--f-num); text-align: right; }
.stat .d.up { color: var(--blue); }
.stat .d.dn { color: var(--red); }
.weight .was { font: 700 13px var(--f-num); color: var(--mute); }
.weight .wb .ghost { position: absolute; left: 0; top: 0; bottom: 0; border-right: 3px dashed var(--blue); background: none; z-index: 1; }
.dk-act { flex: none; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-top: 3px solid var(--ink); background: var(--paper); min-height: 70px; }
.dk-act .btn { flex: 1; min-height: 48px; }
.dk-act .btn.paper { flex: 0 0 auto; }
.dk-hint { font: 900 14px/1.4 var(--f-body); }
.dk-panel .stamp { top: auto; bottom: 80px; right: 20px; }
/* ステッカーの時 */
.dk-stk .stk-grid { display: flex; overflow-x: auto; border-top: 0; border-bottom: 3px solid var(--ink); }
.dk-stk .stk { flex: 0 0 72px; border-bottom: 0; }
.dk-stk .stk:nth-child(4n) { border-right: 3px solid var(--ink); }
.dk-stk .stk.add { flex-basis: 96px; }
.dk-stk .ctl { border-top: 0; }
@media (max-width: 1080px) { .dk-panel { width: 360px; } .dkc { flex-basis: 116px; } }
@media (max-width: 820px) {
  .dk-float { left: 8px; top: 8px; gap: 8px; }
  .dk-float .seg button { min-height: 34px; padding: 0 10px; font-size: 12px; }
  .dk-float .btn.small { min-height: 34px; }
  .dk-title { font-size: 16px; padding: 3px 10px; }
  .dk-panel { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 52%; border-left: 0; border-right: 0; border-bottom: 0; box-shadow: 0 -6px 0 rgba(26, 25, 24, .12); padding-bottom: var(--safe-b); }
  .dks { padding: 4px 1px; min-height: 40px; justify-content: center; }
  .dks b { font-size: 11px; }
  .dks small { display: none; }
  .dkc { flex: 0 0 168px; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; justify-items: start; align-items: center; column-gap: 8px; row-gap: 2px; padding: 6px 8px; text-align: left; }
  .dkc img { width: 56px; grid-row: 1 / 3; }
  .dkc .nm { font-size: 12px; text-align: left; align-self: end; }
  .dkc .tag { align-self: start; }
  .dk-stats .stats.two { grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 4px; padding: 8px 10px 6px; }
  .dk-stats .stat.cmp { grid-template-columns: 54px 1fr 34px 30px; gap: 4px; font-size: 10.5px; }
  .dk-stats .stat .bar { height: 9px; }
  .dk-stats .stat .v { font-size: 14px; }
  .dk-stats .stat .d { font-size: 12px; }
  .dk-stats .weight { padding: 6px 10px 8px; }
  .dk-stats .weight .wb { height: 12px; margin-top: 3px; }
  .dk-act { padding: 8px 10px; min-height: 60px; }
  .dk-act .btn { min-height: 44px; font-size: 16px; }
  .dk-hint { font-size: 12.5px; }
  .dk-stk .stk { flex-basis: 58px; }
  .dk-stk .ctl { padding: 6px 10px; gap: 4px; }
}
@media (max-height: 520px) {
  .dk-panel { left: auto; right: 0; top: 0; bottom: 0; width: min(440px, 56vw); max-height: none; border-left: var(--line) solid var(--ink); }
  .dk-stats .stats.two { grid-template-columns: 1fr 1fr; }
}

/* 拠点の「遊び方」ボタンと、そのページ */
.hub-howto { position: absolute; left: 14px; top: 12px; }
@media (max-width: 820px) { .hub-howto { left: 8px; top: 8px; } }
.howto { position: absolute; left: 50%; top: 14px; bottom: 14px; width: min(760px, calc(100% - 24px)); transform: translateX(-50%); display: flex; flex-direction: column; box-shadow: 8px 8px 0 var(--ink); }
.howto .ph { padding: 6px 8px 6px 14px; font-size: 16px; }
.ht-body { overflow: auto; overscroll-behavior: contain; padding: 4px 0 10px; scrollbar-width: thin; }
.ht-sec { padding: 10px 16px 6px; border-bottom: 3px solid var(--ink); }
.ht-sec:last-child { border-bottom: 0; }
.ht-sec h3 { margin: 0 0 6px; display: flex; gap: 10px; align-items: center; font: 400 18px var(--f-disp); }
.ht-sec h3 .k { font: 900 15px var(--f-num); background: var(--red); color: #fff; padding: 1px 7px; }
.ht-sec p { margin: 0 0 6px; font: 500 14px/1.7 var(--f-body); }
.ht-sec p b { display: inline-block; min-width: 6.5em; margin-right: 8px; font-weight: 900; }
@media (max-width: 820px) { .howto { top: 8px; bottom: 8px; } .ht-sec { padding: 8px 12px 4px; } .ht-sec p { font-size: 13px; } .ht-sec p b { display: block; min-width: 0; } }

/* 漢字の入る見出しは Zen Kaku Gothic New の一番太い字（Dela Gothic One は小さい漢字の中がつぶれて読めない）。
   Dela はかなと英数字だけの見出しと、40px 以上の大きな字に使う */
.tile.mission .t, .opp .oh b, .board-h h2, .ladder h2, .mis .mh b, .mbox .mt h3, .tutwin .tt, .ht-sec h3, .starter-h h2, .scard .sh, .stamp, .callout, .vs .nm, .tut-ok, .dk-title {
  font-family: var(--f-body); font-weight: 900; letter-spacing: .02em;
}

/* スマホの拠点：札を高くして、シルエットを題字の下へ */
@media (max-width: 560px) {
  .hub.five { height: min(500px, 60vh); grid-template-rows: repeat(6, minmax(48px, 1fr)) auto; }
  .tile.mission { --ms: 74%; } .tile.garage { --ms: 42%; } .tile.shop { --ms: 72%; }
}

@media (max-height: 520px) { .hub-howto { left: auto; right: 10px; top: 8px; } }
.weight .ovt { font: 900 11px var(--f-body); font-style: normal; background: var(--red); color: #fff; padding: 1px 6px; margin-left: 6px; }
.nw { white-space: nowrap; }
.dk-stats .wrows { border-bottom: 3px solid var(--ink); background: #fff; }
@media (max-width: 820px) { .dk-stats .wrows .stat.cmp { grid-template-columns: 62px 1fr 38px 34px; } }
@media (max-width: 400px) { .dk-stats .stats.two.wrows { grid-template-columns: 1fr; } .dk-stats .wrows .stat.cmp { grid-template-columns: 62px 1fr 40px 46px; } }

/* ---------------------------------------------------------------- 題名の画面：ロゴと2つのボタンだけ（後ろに3Dの機体） */
.title3 { position: absolute; inset: 0; }
.t3-logo { position: absolute; left: clamp(20px, 4vw, 64px); top: 50%; transform: translateY(-62%); width: min(560px, 44vw); margin: 0; }
.logo3 { display: block; width: 100%; height: auto; overflow: visible; }
.t3-menu { position: absolute; left: clamp(20px, 4vw, 64px); top: calc(50% + min(560px, 44vw) * .3); width: min(420px, 36vw); display: flex; flex-direction: column; border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }
.t3b { --sweep: -20%; position: relative; display: grid; grid-template-columns: 100px 1fr auto; align-items: center; gap: 12px; min-height: 62px; padding: 0 18px 0 0; border: 0; text-align: left; overflow: hidden; background: var(--paper2); color: var(--ink); }
.t3b + .t3b { border-top: 4px solid var(--ink); }
.t3b .tk { align-self: stretch; display: grid; place-items: center; font: 600 11.5px var(--f-mono); letter-spacing: .1em; background: var(--ink); color: var(--paper2); }
.t3b .tl { font: 900 20px var(--f-body); letter-spacing: .06em; }
.t3b.cont { background: var(--red); color: #fff; }
.t3b::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--sweep); width: 18%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent); transform: skewX(-20deg); pointer-events: none; }
.t3b[disabled] { background: var(--paper); color: var(--mute); cursor: default; }
.t3b[disabled] .tk { background: var(--mute); }
.t3b[disabled]::after { display: none; }
.t3b .arrow { transition: transform .15s; }
.t3b:not([disabled]):hover .arrow { transform: translateX(6px); }
.t3b:not([disabled]):active { filter: brightness(.9); }
@media (max-width: 820px) {
  .t3-logo { left: 50%; top: max(18px, 4vh); transform: translateX(-50%); width: min(500px, 88vw); }
  .t3-menu { left: 50%; transform: translateX(-50%); top: auto; bottom: calc(18px + var(--safe-b)); width: min(420px, 88vw); }
  .t3b { min-height: 56px; grid-template-columns: 86px 1fr auto; }
  .t3b .tl { font-size: 18px; }
}
@media (max-height: 520px) and (min-width: 600px) {
  .t3-logo { left: 20px; top: 10px; transform: none; width: min(340px, 40vw); }
  .t3-menu { left: 24px; right: auto; top: auto; bottom: 12px; transform: none; width: min(330px, 38vw); }
  .t3b { min-height: 48px; } .t3b .tl { font-size: 16px; }
}

/* クラスごとの VS（D 予選・C 本戦・B 準決勝・A 決勝） */
.vs .vcls { position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; gap: 12px; padding: 8px 20px 10px; background: var(--ink); color: var(--paper2); border: 4px solid var(--ink); border-top: 0; }
.vs .vcls b { font: 900 clamp(20px, 3vw, 30px)/1 var(--f-num); letter-spacing: .06em; color: var(--yellow); }
.vs .vcls span { font: 900 clamp(15px, 2vw, 20px) var(--f-body); }
.vs.cls-C .b { background: var(--yellow); color: var(--ink); }
.vs.cls-C .b .k { color: var(--ink); }
.vs.cls-B .a { background: var(--ink); }
.vs.cls-B .b { background: var(--red); }
.vs.cls-B .vcls { background: var(--red); border-color: var(--ink); }
.vs.cls-A .a { background: var(--red); }
.vs.cls-A .b { background: var(--ink); }
.vs.cls-A .a::after, .vs.cls-A .b::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22px; background: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, var(--ink) 14px 28px); }
.vs.cls-A .vcls { background: var(--yellow); color: var(--ink); }
.vs.cls-A .vcls b { color: var(--red); }
.vs.cls-A .mid { font-size: clamp(100px, 20vw, 220px); }
.vs .confetti { position: absolute; inset: 0; pointer-events: none; }
.vs .confetti i { position: absolute; left: 0; top: 0; width: 12px; height: 7px; }
/* 昇格の判 */
.promo { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 3; }
.promo .pw { display: grid; justify-items: center; gap: 4px; padding: 18px 34px 22px; background: var(--paper2); border: 6px solid var(--red); box-shadow: 10px 10px 0 var(--ink); transform: rotate(-6deg); }
.promo .k { font: 600 14px var(--f-mono); letter-spacing: .3em; color: var(--red); }
.promo b { font: 900 clamp(90px, 16vw, 160px)/0.9 var(--f-num); color: var(--ink); }
.promo .t { font: 900 15px var(--f-body); }
.promo.cls-B .pw { border-color: var(--blue); } .promo.cls-B .k { color: var(--blue); }
.promo.cls-A .pw { border-color: var(--yellow); background: var(--ink); } .promo.cls-A b, .promo.cls-A .t { color: var(--paper2); } .promo.cls-A .k { color: var(--yellow); }
/* 左の武器の「なし」・フィールドで手に入る印・機体の強化 */
.dkc .noimg { width: 100%; aspect-ratio: 1; display: grid; place-items: center; border: 2px dashed var(--ink); background: var(--paper); font: 900 15px var(--f-body); }
.tag.field { background: var(--blue); color: #fff; border-color: var(--blue); }
.tune-list { display: grid; }
.tune-row { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 12px; align-items: center; padding: 10px 12px; border-bottom: 3px solid var(--ink); }
.tune-row .tn { display: flex; align-items: center; gap: 10px; }
.tune-row .tn b { font: 900 16px var(--f-body); min-width: 3em; }
.tune-row .pips { display: flex; gap: 4px; }
.tune-row .pips i { width: 16px; height: 12px; border: 2px solid var(--ink); background: var(--paper); transform: skewX(-14deg); }
.tune-row .pips i.on { background: var(--red); }
.tune-row .tnote { grid-column: 1; font: 700 12.5px/1.5 var(--f-body); color: var(--mute); }
.tune-row .up { grid-column: 2; grid-row: 1 / 3; min-width: 9em; }
@media (max-width: 820px) {
  .tune-row { padding: 6px 10px; }
  .tune-row .tn b { font-size: 14px; }
  .tune-row .tnote { font-size: 11px; }
  .tune-row .up { min-width: 0; font-size: 12.5px; padding: 0 10px; min-height: 36px; }
  .dkc .noimg { width: 56px; grid-row: 1 / 3; font-size: 12px; }
}

/* フィールドの一覧 */
.fld-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fld { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; background: var(--paper2); border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.fld .fh { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fld .fh b { font: 900 24px var(--f-body); }
.fld p { margin: 0; font: 600 13px/1.6 var(--f-body); }
.fld .fms { display: grid; gap: 6px; }
.fmb { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; text-align: left; border: 3px solid var(--ink); background: #fff; padding: 6px 10px; font: 800 13.5px var(--f-body); }
.fmb .num { font: 900 16px var(--f-num); }
.fmb:hover:not([disabled]) { background: var(--yellow); }
.fmb[disabled] { opacity: .5; cursor: default; }
.fld .explore { align-self: flex-start; }
.fld.locked { background: var(--paper); }
.fld.locked .fh b, .fld.locked p { color: var(--mute); }
@media (max-width: 820px) { .fld-grid { grid-template-columns: 1fr; } .fld .fh b { font-size: 20px; } }
/* フィールドのショップのボタンと窓 */
#hud .fshop { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); pointer-events: auto; min-width: 160px; z-index: 4; }
.fshopm .fs-list { max-height: min(52vh, 420px); overflow: auto; padding: 6px 12px; }
.fs-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 2px solid var(--paper); font: 800 13.5px var(--f-body); }
.fs-row img { width: 52px; height: 52px; border: 2px solid var(--ink); background: var(--paper); }
.fs-row.rep { grid-template-columns: 1fr auto; padding: 8px 12px; border-top: 3px solid var(--ink); }
.fs-none { padding: 14px 0; font: 700 14px/1.6 var(--f-body); }
.fshopm .ma { justify-content: space-between; align-items: center; }
.fshopm .fs-cr { font: 900 22px var(--f-num); }
.mbox .mt.blue { background: var(--blue); color: #fff; }

/* フィールドの一覧：つながった地図の小さな図（北西＝山・北東＝街中・南西＝荒野・南東＝港、真ん中にドック） */
.fieldsc .board-h { gap: 10px; }
.fieldsc .board-h .explore { margin-left: auto; }
.fmap { position: relative; width: 120px; height: 120px; display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; grid-template-areas: 'mount mount town' 'jungle wild port'; gap: 6px; padding: 0; background: #2f5f86; border: 4px solid var(--ink); margin: 0 0 10px; border-radius: 28% 18% 22% 30%; overflow: hidden; }
.fmap .q.mount { background: #9fae86; grid-area: mount; } .fmap .q.town { background: #c9c6bf; grid-area: town; } .fmap .q.jungle { background: #4c7a3a; grid-area: jungle; } .fmap .q.wild { background: #d8c39a; grid-area: wild; } .fmap .q.port { background: #a9abaa; grid-area: port; }
.fmap .dock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--red); color: #fff; font: 600 9px var(--f-mono); padding: 2px 4px; border: 2px solid var(--ink); }
#hud .fdock { position: absolute; left: 50%; bottom: 176px; transform: translateX(-50%); pointer-events: auto; min-width: 180px; z-index: 4; }
#hud .wanted { position: absolute; right: 12px; top: 174px; background: var(--ink); color: var(--paper2); border: 3px solid var(--red); font: 900 15px var(--f-body); padding: 5px 12px 6px; z-index: 4; display: grid; gap: 4px; min-width: 150px; }
#hud .wanted[hidden] { display: none; }
#hud .wanted b { font: 900 15px var(--f-body); letter-spacing: .04em; }
#hud .wanted .hbar { display: block; height: 6px; background: #3b3e41; }
#hud .wanted .hbar i { display: block; height: 100%; background: var(--red); transition: width .3s; }
#hud .wanted span { font: 600 12px var(--f-mono); color: #f3f0e8; }
@media (max-width: 820px) { .fmap { width: 84px; height: 84px; } #hud .wanted { top: 196px; min-width: 130px; } }

/* チーム戦（相手の一覧） */
.cls-row.team .ck { font-size: 20px; background: var(--red); color: #fff; }
.opp.team { display: flex; flex-direction: column; gap: 10px; min-height: 140px; }
.opp.team .tmem { font: 800 14px/1.6 var(--f-body); padding: 0 12px; }
.opp.team.locked { opacity: .55; }
.opp.team .tlock { padding: 0 12px 10px; font: 700 12.5px var(--f-body); color: var(--mute); }

/* ---- 操作の案内（キーの形＋動きの絵。文で説明しない） */
.ctlg { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; align-items: center; }
.ctlg .cg { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.ctlg kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border: 2px solid currentColor; border-bottom-width: 3px; font: 700 11px/1 var(--f-num, monospace); }
.ctlg kbd.w { min-width: 40px; }
.ctlg .ci svg, .ctlg .cg > svg { width: 20px; height: 20px; margin-left: 2px; }
.ctlg .ms { width: 15px; height: 20px; overflow: visible; }
.ctlg .ci { display: inline-grid; place-items: center; width: 24px; height: 24px; background: var(--ink); color: var(--paper2); border-radius: 50%; }
.ctlg .ci svg { width: 16px; height: 16px; margin: 0; }
.ctlg.touch .tch { display: inline-block; border: 2px solid currentColor; }
.ctlg.touch .tch.stick { width: 26px; height: 26px; border-radius: 50%; border-style: dashed; }
.ctlg.touch .tch.swipe { width: 34px; height: 4px; border-width: 0 0 3px; border-style: solid; position: relative; }
.ctlg.touch .tch.pinch { width: 26px; height: 26px; border-radius: 50%; border-style: dotted; }
.ctlg.touch .tch.btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; margin: 0 1px; }
.ctlg.touch .tch.btn svg { width: 16px; height: 16px; }
.modal .mc .ctlg { justify-content: flex-start; color: var(--ink); }
.fm-guide .ctlg { color: var(--ft, var(--ink)); }
/* ---- 画面の真ん中の照準（切り替えできる） */
#hud .xhair { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; pointer-events: none; z-index: 2; }
#hud .xhair[hidden] { display: none; }
#hud .xhair > i { position: absolute; background: #fff; box-shadow: 0 0 0 1.5px var(--ink); }
#hud .xhair > i:nth-child(1), #hud .xhair > i:nth-child(2) { left: 14px; width: 2px; height: 9px; }
#hud .xhair > i:nth-child(1) { top: 0; } #hud .xhair > i:nth-child(2) { bottom: 0; }
#hud .xhair > i:nth-child(3), #hud .xhair > i:nth-child(4) { top: 14px; height: 2px; width: 9px; }
#hud .xhair > i:nth-child(3) { left: 0; } #hud .xhair > i:nth-child(4) { right: 0; }
#hud .xhair > b { position: absolute; left: 13px; top: 13px; width: 4px; height: 4px; background: var(--red); border-radius: 50%; }
#hud .xbtn { position: absolute; right: 10px; top: 124px; pointer-events: auto; z-index: 4; width: 40px; height: 40px; display: grid; place-items: center; border: 3px solid var(--ink); background: var(--paper2); color: var(--ink); }
#hud .xbtn svg { width: 22px; height: 22px; }
#hud .xbtn:not(.on) { opacity: 0.55; }
body.mlook #gl { cursor: none; }
/* 頭が壊れた時の視界：ノイズ・走査線・横ずれ */
#hud .jam { position: absolute; inset: 0; pointer-events: none; z-index: 1; mix-blend-mode: multiply; opacity: .42; }
#hud .jam canvas { width: 100%; height: 100%; image-rendering: pixelated; transform: translateX(var(--jx, 0)); }
#hud .jam::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.35) 0 2px, transparent 2px 5px); }
#hud .jam .bar { position: absolute; left: 0; right: 0; top: 38%; height: 14px; background: rgba(255,255,255,.7); transform: translateX(var(--jx, 0)); }
#hud .jam .bar.b2 { top: 71%; height: 7px; }
#hud .jam.flick { opacity: .7; }
/* 依頼の一覧：場所のタブ */
.mtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.mtab { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border: 3px solid var(--ink); background: var(--paper2); font: 900 14px var(--f-body); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.mtab .num { font-size: 12px; opacity: .7; }
.mtab.on { background: var(--ink); color: var(--paper2); }
.mtab.locked { opacity: .55; }
.mtab .lk { font-size: 10px; border: 1.5px solid currentColor; padding: 0 4px; }
.mis.locked { opacity: .5; }
.mis .lockm { position: absolute; right: 8px; bottom: 34px; font: 900 11px var(--f-body); background: var(--ink); color: var(--paper2); padding: 2px 6px; }
.board-h .mcount { font: 900 18px var(--f-num); margin-left: auto; margin-right: 10px; }
/* 試合の下の操作の案内は、1行に収まる広い画面だけ（狭い画面は中断の窓と遊び方のページで見る） */
@media (max-width: 1199px) { #hud .fm-guide { display: none; } }

/* ---------------------------------------------------------------- 設定の窓 */
.iconbtn.cfgbtn svg { width: 22px; height: 22px; display: block; margin: auto; }
.modal.cfg .cfg-box { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.modal.cfg .mt { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal.cfg .cfg-body { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; }
.cfg-body section { border-top: 3px solid var(--ink); padding: 10px 0 6px; }
.cfg-body section:first-child { border-top: 0; }
.cfg-body h4 { font: 900 15px var(--f-body); margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.cfg-body h4 .k { font: 600 11px var(--f-mono); background: var(--ink); color: var(--paper2); padding: 1px 6px; }
.cfg-row { display: grid; grid-template-columns: 8.5em 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(26,25,24,.15); }
.cfg-l { font: 700 14px var(--f-body); }
.seg { display: flex; flex-wrap: wrap; border: 2px solid var(--ink); width: fit-content; max-width: 100%; }
.seg button { font: 700 13px var(--f-body); padding: 7px 12px; background: var(--paper2); color: var(--ink); border: 0; border-right: 2px solid var(--ink); cursor: pointer; min-height: 36px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--paper2); }
.seg.col { flex-direction: column; width: 100%; }
.seg.col button { border-right: 0; border-bottom: 2px solid var(--ink); text-align: left; }
.seg.col button:last-child { border-bottom: 0; }
.rng { display: flex; align-items: center; gap: 10px; }
.rng input { flex: 1; min-width: 0; accent-color: var(--red); height: 28px; }
.rng output { font: 600 13px var(--f-mono); min-width: 3.4em; text-align: right; }
.cfg-note { font: 500 13px var(--f-body); margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 480px) { .cfg-row { grid-template-columns: 1fr; gap: 6px; } }
