/*
 * UNDER LAYERS — 演出(戦闘再生ビューア・バトル演出・音の設定)
 * トークンは kb.css の :root を使う。攻性(防御側の反撃・焼却)は赤、逆探知はアンバー→赤、解析は シアン。
 * prefers-reduced-motion では揺れ・点滅・浮き上がりを止め、色と文字だけにする(末尾)。
 */

/* ============================================================ test run: replay buttons */

.sim-replay {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin: 10px 0 0;
	font-size: var(--fs-s);
}

.sim-replay-k {
	color: var(--sub);
	font-size: var(--fs-xs);
	letter-spacing: .08em;
}

.sim-replay .btn.sm {
	padding: 3px 10px;
	font-size: 13px;
	border-color: var(--fg);
}

.sim-replay-info {
	flex: 1 1 16em;
	min-width: 0;
	color: var(--sub);
	font-size: var(--fs-xs);
}

.sim-raw {
	margin: 10px 0 0;
	font-size: var(--fs-s);
}

.sim-raw > summary {
	color: var(--sub);
	cursor: pointer;
}

.sim-raw > summary:hover,
.sim-raw > summary:focus-visible {
	color: var(--fg);
}

/* ============================================================ dialog */

html.rp-lock {
	overflow: hidden;
}

.rp-dialog {
	width: min(1440px, calc(100vw - 24px));
	max-width: none;
	height: calc(100vh - 24px);
	height: calc(100dvh - 24px);
	max-height: none;
	margin: auto;
	padding: 0;
	color: var(--fg);
	background: var(--bg);
	border: 1px solid var(--line-hi);
	overflow: hidden;
}

.rp-dialog::backdrop {
	background: rgba(3, 0, 5, .86);
}

/* ============================================================ viewer layout */

.rp {
	position: relative;
	display: grid;
	grid-template-rows: auto auto minmax(0, 1fr);
	height: 100%;
	font-size: var(--fs-s);
	outline: none;
}

.rp .sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.rp-head .band {
	gap: 10px;
}
/* 見出しのアイコン(題の省略表示を壊さないよう、題の span の外に置く) */
.rp-head .band > .pi {
	align-self: center;
	margin-right: -4px;
}

.rp-title {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rp-meta {
	overflow: hidden;
	text-overflow: ellipsis;
}

.rp-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	padding: 6px 10px;
	border-bottom: 1px solid var(--line);
}

.rp-tools .rp-close {
	margin-left: auto;
	border-color: var(--fg);
}

.rp-pers[aria-pressed="false"] {
	color: var(--warn);
	border-color: var(--warn);
}

/* 操作列 */
.rp-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
	padding: 6px 10px;
	background: var(--bg-1);
	border-bottom: 1px solid var(--line);
}

.rp-transport,
.rp-speeds {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
}

.rp .btn.sm.rp-c {
	padding: 2px 6px;
	font-size: 12px;
}

.rp .btn.sm.rp-play {
	min-width: 8.5em;
	border-color: var(--fg);
	color: var(--fg-hi);
}

.rp .btn.sm.rp-play[aria-pressed="true"] {
	color: var(--bg);
	background: var(--fg);
}

.rp .btn.sm.rp-skip {
	border-color: var(--warn);
}

.rp-k {
	color: var(--sub);
	font-size: var(--fs-xs);
	letter-spacing: .08em;
}

.rp-seekwrap {
	display: flex;
	flex: 1 1 300px;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.rp-seekbar {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	padding-top: 6px;
}

.rp-seek {
	display: block;
	width: 100%;
	margin: 0;
	accent-color: var(--fg);
	cursor: pointer;
}

.rp-ticks {
	position: absolute;
	top: 0;
	left: 8px;
	right: 8px;
	height: 8px;
	pointer-events: none;
}

.rp-ticks i {
	position: absolute;
	top: 3px;
	width: 1px;
	height: 5px;
	background: var(--line-hi);
}

.rp-ticks i.major {
	top: 0;
	height: 8px;
	background: var(--sub);
}

.rp-ticks i.b {
	top: 0;
	width: 2px;
	height: 8px;
	background: var(--alert);
}

.rp-ticks i.a {
	top: 0;
	width: 2px;
	height: 8px;
	background: var(--warn);
}

.rp-ticks i.r {
	top: -1px;
	width: 3px;
	height: 10px;
	background: var(--fg-hi);
}

.rp-counter {
	color: var(--sub);
	font-size: var(--fs-xs);
	white-space: pre;
}

/* 盤面 + ログ */
.rp-main {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(320px, 1fr);
	min-height: 0;
}

.rp-stage {
	position: relative;
	min-height: 0;
	overflow: hidden;
	border-right: 1px solid var(--line);
}

.rp-scroll {
	height: 100%;
	overflow: auto;
	padding: 10px 12px 16px;
	overscroll-behavior: contain;
}

.rp-logcol {
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: auto;
	padding: 10px 12px;
	gap: 10px;
}

.rp-logbox {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 220px;
	border: 1px solid var(--line);
}

.rp-band2 {
	font-size: 11pt;
}

/* ============================================================ board: intruder HUD */

.rp-hud {
	display: grid;
	gap: 5px;
	padding: 8px 10px;
	background: var(--bg-1);
	border: 1px solid var(--line-hi);
}

.rp-hud-top {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
}

.rp-who {
	color: var(--sub);
	font-size: var(--fs-xs);
	letter-spacing: .08em;
}

.rp-turn {
	margin-left: auto;
	color: var(--fg-hi);
	font-size: 18px;
	line-height: 1.1;
	letter-spacing: .04em;
}

.rp-ward {
	color: var(--cyan);
	font-size: var(--fs-xs);
	border: 1px solid var(--cyan);
	padding: 0 4px;
}

.rp-lock {
	color: var(--warn);
	font-size: var(--fs-xs);
	border: 1px solid var(--warn);
	padding: 0 4px;
}

.rp-gauge {
	display: grid;
	grid-template-columns: 8.2em minmax(0, 1fr) 4.6em;
	align-items: center;
	gap: 8px;
}

.rp-g-k {
	color: var(--sub);
	font-size: var(--fs-xs);
	white-space: nowrap;
}

.rp-g-bar {
	position: relative;
	height: 12px;
	background: #050007;
	border: 1px solid var(--line);
	overflow: hidden;
}

.rp-g-bar i {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 0;
}

.rp-g-ghost {
	background: rgba(255, 255, 255, .28);
	transition: width .7s ease .45s;
}

.rp-g-fill {
	background: var(--fg);
	background-image: repeating-linear-gradient(90deg, transparent 0 7px, rgba(11, 0, 15, .45) 7px 8px);
	transition: width .32s ease-out, background-color .3s;
}

.rp-g-val {
	color: var(--fg-hi);
	font-size: var(--fs-s);
	text-align: right;
	white-space: nowrap;
}

.rp-gauge.stb[data-level="low"] .rp-g-fill { background-color: var(--warn); }
.rp-gauge.stb[data-level="crit"] .rp-g-fill { background-color: var(--alert); }
.rp-gauge.stb[data-level="crit"] .rp-g-val { color: var(--alert-hi); }

.rp-gauge.trace .rp-g-fill { background-color: #c99a3a; }
.rp-gauge.trace[data-level="warn"] .rp-g-fill { background-color: var(--warn); }
.rp-gauge.trace[data-level="hot"] .rp-g-fill,
.rp-gauge.trace[data-level="crit"] .rp-g-fill { background-color: var(--alert); }
.rp-gauge.trace[data-level="hot"] .rp-g-val,
.rp-gauge.trace[data-level="crit"] .rp-g-val { color: var(--alert-hi); }
.rp-gauge.trace[data-level="hot"] .rp-g-bar { animation: rp-blink-border 1.1s steps(2, end) infinite; }
.rp-gauge.trace[data-level="crit"] .rp-g-bar { animation: rp-blink-border .5s steps(2, end) infinite; }

.rp-pips {
	display: flex;
	flex-wrap: wrap;
	gap: 3px;
}

.rp-pips i {
	width: 14px;
	height: 10px;
	border: 1px solid var(--line-hi);
	background: #050007;
	transition: background-color .2s;
}

.rp-pips i.on {
	background: var(--cyan);
	border-color: var(--cyan);
}

.rp-statuses {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 6px;
	min-height: 22px;
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
}

.rp-st {
	--sc: var(--warn);
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 0 4px 0 0;
	color: var(--sc);
	border: 1px solid var(--sc);
	font-size: var(--fs-xs);
	line-height: 18px;
}

.rp-st.none {
	color: var(--muted);
	border-color: var(--line);
	padding: 0 6px;
}

.rp-st .rp-st-ic {
	width: 18px;
	height: 18px;
	color: var(--bg);
	background: var(--sc);
	text-align: center;
	text-decoration: none;
	font-weight: bold;
}

/* ============================================================ board: layer stack */

.rp-dive {
	margin-top: 10px;
}

.rp-edge {
	color: var(--muted);
	font-size: var(--fs-xs);
	text-align: center;
	letter-spacing: .1em;
	margin: 4px 0;
}

.rp-stack {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rp-layer {
	--d: 0;
	position: relative;
	margin-inline: calc(var(--d) * 9px);
	padding: 6px 8px 7px;
	background: var(--bg-1);
	border: 1px solid var(--line-hi);
	transition: opacity .4s, border-color .3s, background-color .3s;
}

/* 層の間の点線(ダイブの縦の流れ) */
.rp-layer + .rp-layer::after {
	content: "";
	position: absolute;
	left: 50%;
	top: -11px;
	height: 10px;
	border-left: 1px dashed var(--line-hi);
}

.rp-layer[data-here="1"] {
	border-color: var(--fg);
	background: #160b1f;
	box-shadow: 0 0 0 1px rgba(127, 221, 87, .35), 0 0 16px rgba(127, 221, 87, .16);
}

.rp-lhead {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 8px;
	min-width: 0;
}

.rp-lno {
	color: var(--bg);
	background: var(--line-hi);
	padding: 0 4px;
	font-size: var(--fs-xs);
}

.rp-layer[data-here="1"] .rp-lno {
	background: var(--fg);
}

.rp-lname {
	color: var(--fg-hi);
	font-size: var(--fs-m);
	min-width: 0;
}

.rp-unknown {
	color: var(--muted);
	letter-spacing: .06em;
}

.rp-ltags .tag {
	font-size: var(--fs-xs);
}

.rp-lflags {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 3px;
}

.rp-flag {
	padding: 0 3px;
	color: var(--sub);
	border: 1px solid var(--line-hi);
	font-size: 10px;
	line-height: 15px;
}

.rp-flag.camo { color: #d78bff; border-color: #6c3f86; }
.rp-flag.ana { color: var(--cyan); border-color: #2c6772; }
.rp-flag.spawn { color: var(--cyan); border-color: var(--cyan); }
.rp-flag.mark { color: var(--warn); border-color: #7a6528; }
.rp-flag.byp { color: var(--warn); border-color: var(--warn); }

.rp-here {
	display: none;
	margin-left: auto;
	color: var(--fg);
	font-size: var(--fs-xs);
	animation: rp-cursor 1s steps(2, end) infinite;
}

.rp-layer[data-here="1"] .rp-here {
	display: inline;
}

.rp-lint {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
}

.rp-lint .rp-gauge {
	flex: 1 1 auto;
	grid-template-columns: 2.4em minmax(0, 1fr) 4.2em;
}

.rp-lint .rp-gauge[data-low="1"] .rp-g-fill {
	background-color: var(--warn);
}

.rp-shield {
	color: var(--cyan);
	border: 1px solid var(--cyan);
	padding: 0 4px;
	font-size: var(--fs-xs);
	white-space: nowrap;
}

.rp-harden {
	color: var(--sub);
	border: 1px solid var(--line-hi);
	padding: 0 4px;
	font-size: var(--fs-xs);
	white-space: nowrap;
}

.rp-mods {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 5px;
}

.rp-mod {
	position: relative;
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	padding: 0 6px;
	border: 1px solid var(--line-hi);
	background: #0d0412;
	font-size: var(--fs-s);
	overflow: hidden;
}

.rp-mod.is-hidden {
	color: var(--muted);
	letter-spacing: .15em;
}

.rp-mod.noise {
	letter-spacing: .02em;
	font-size: var(--fs-xs);
}

.rp-mod.empty {
	color: var(--muted);
	border-style: dashed;
}

.rp-mod.is-secret {
	border-style: dashed;
	border-color: #6c3f86;
}

.rp-secret-k {
	color: #b98bd0;
	font-size: 10px;
}

.rp-stamp {
	position: absolute;
	right: 8px;
	top: 6px;
	color: var(--alert-hi);
	font-size: var(--fs-xs);
	letter-spacing: .08em;
	pointer-events: none;
}

.rp-stamp:empty {
	display: none;
}

.rp-layer[data-status="breached"] {
	opacity: .55;
	border-color: #4a1f24;
	background: repeating-linear-gradient(135deg, #10050f 0 6px, #170811 6px 12px);
}

.rp-layer[data-status="breached"] .rp-lname {
	text-decoration: line-through;
	text-decoration-color: var(--alert);
}

.rp-layer[data-status="breached"] .rp-g-fill {
	background-color: var(--alert);
}

.rp-layer[data-status="bypassed"] {
	border-style: dashed;
	border-color: var(--warn);
}

.rp-layer[data-status="bypassed"] .rp-stamp {
	color: var(--warn);
}

/* 中枢 */
.rp-core {
	position: relative;
	margin: 0 auto;
	width: min(100%, 360px);
	padding: 10px 12px;
	color: var(--alert-hi);
	background: var(--bg-deep);
	border: 1px solid var(--alert);
	text-align: center;
	overflow: hidden;
	isolation: isolate;
}

.rp-core-k {
	display: block;
	font-size: var(--fs-xs);
	letter-spacing: .1em;
}

.rp-core-name {
	position: relative;
	font-size: var(--fs-m);
}

.rp-core-door {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 50%;
	z-index: -1;
	background: repeating-linear-gradient(90deg, rgba(255, 64, 64, .14) 0 2px, transparent 2px 6px);
	transition: transform 1.2s cubic-bezier(.7, 0, .3, 1);
}

.rp-core-door.l { left: 0; border-right: 1px solid rgba(255, 64, 64, .4); }
.rp-core-door.r { right: 0; border-left: 1px solid rgba(255, 64, 64, .4); }

.rp-core[data-open="1"] {
	color: var(--fg-hi);
	border-color: var(--fg);
	background: radial-gradient(ellipse at center, rgba(127, 221, 87, .3), var(--bg-deep) 70%);
}

.rp-core[data-open="1"] .rp-core-door.l { transform: translateX(-100%); }
.rp-core[data-open="1"] .rp-core-door.r { transform: translateX(100%); }

/* カード名(クリックで効果文) */
.rp .rp-card {
	padding: 0;
	color: inherit;
	background: none;
	border: 0;
	font: inherit;
	text-decoration: underline dotted;
	text-underline-offset: 3px;
	text-decoration-color: rgba(166, 240, 138, .45);
	cursor: pointer;
}

.rp .rp-card:hover,
.rp .rp-card:focus-visible {
	color: var(--bg);
	background: var(--fg);
	text-decoration: none;
	outline: none;
}

.rp .rp-card.is-secret {
	color: #c9a0de;
}

/* リザルトの表のカード名の「i」(カードの詳細。kb.css の .ci-i) */
.rp .rp-card:hover .ci-i,
.rp .rp-card:focus-visible .ci-i,
.rp .rp-card[aria-expanded="true"] .ci-i { color: inherit; background: none; border-color: currentColor; }

.rp .rp-st .rp-st-ic {
	color: var(--bg);
	background: var(--sc);
	text-decoration: none;
}

.rp .rp-st .rp-st-ic:hover,
.rp .rp-st .rp-st-ic:focus-visible {
	color: var(--sc);
	background: var(--bg);
}

/* カードの効果のポップアップは全ページ共通の「カードの詳細」(kb.css の .ci-pop・assets/js/card-info.js)に置き換えた */

.rp-sub {
	color: var(--sub);
	font-size: var(--fs-xs);
}

/* ============================================================ detailed log */

.rp-log {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	padding: 4px 0;
	background: #050007;
	font-size: var(--fs-s);
	line-height: 1.55;
	overscroll-behavior: contain;
}

.rp-blk {
	padding: 4px 8px 5px 10px;
	border-left: 3px solid transparent;
	cursor: pointer;
}

.rp-blk:hover {
	background: rgba(127, 221, 87, .04);
}

.rp-blk.is-cur {
	border-left-color: var(--fg);
	background: rgba(127, 221, 87, .08);
}

.rp-blk[data-big="breach"] { border-left-color: rgba(255, 64, 64, .55); }
.rp-blk[data-big="alarm"] { border-left-color: rgba(232, 193, 90, .55); }
.rp-blk[data-big="result"] { border-left-color: var(--warn); }
.rp-blk.is-cur[data-big="breach"] { border-left-color: var(--alert); }

.rp-blk-no {
	display: block;
	color: var(--muted);
	font-size: 10px;
	letter-spacing: .05em;
}

.rp-ln {
	display: block;
	padding-left: 1.4em;
	text-indent: -1.4em;
	overflow-wrap: anywhere;
}

.rp-ln.k-cause {
	padding-left: 0;
	text-indent: 0;
	color: var(--fg-hi);
	font-weight: bold;
}

.rp-ln.k-note { color: #8fbfc7; font-size: var(--fs-xs); padding-left: 1.4em; text-indent: 0; }
.rp-ln.k-note::before { content: "// "; color: var(--muted); }
.rp-ln.k-atk { color: #d9f7cf; }
.rp-ln.k-burn { color: var(--alert-hi); }
.rp-ln.k-trace { color: var(--warn); }
.rp-ln.k-status { color: #d78bff; }
.rp-ln.k-reveal { color: var(--cyan); }
.rp-ln.k-def { color: var(--fg); }
.rp-ln.k-heal { color: #8fd8e4; }
.rp-ln.k-enter { color: var(--fg-hi); }
.rp-ln.k-act { color: var(--fg); }
.rp-ln.k-dim { color: var(--muted); }
.rp-ln.k-sys { color: var(--warn); padding-left: 0; text-indent: 0; }
.rp-ln.k-turn { color: var(--sub); padding-left: 0; text-indent: 0; letter-spacing: .05em; }

.rp-ln.k-breach {
	margin: 2px 0;
	padding: 0 6px;
	text-indent: 0;
	color: #ffd9d6;
	background: rgba(255, 64, 64, .2);
	border-left: 2px solid var(--alert);
	font-weight: bold;
}

.rp-ln.k-result {
	margin-top: 3px;
	padding-left: 0;
	text-indent: 0;
	color: var(--warn);
	font-weight: bold;
}

/* ============================================================ 今の手のキャプション(狭い画面だけ) */

.rp-caption {
	display: none;
}

.rp-auto[aria-pressed="true"] {
	color: var(--bg);
	background: var(--warn);
	border-color: var(--warn);
}

/* ============================================================ result */

.rp-result {
	border: 1px solid var(--line-hi);
	background: var(--bg);
}

.rp-result[data-win="0"] {
	border-color: var(--alert);
}

.rp-result-body {
	padding: 8px 10px 10px;
}

.rp-verdict {
	margin: 0;
	font-size: var(--fs-m);
}

.rp-verdict b {
	color: var(--fg-hi);
	font-size: 20px;
}

.rp-result[data-win="0"] .rp-verdict b {
	color: var(--alert-hi);
}

.rp-en {
	margin-left: 10px;
	color: var(--sub);
	font-size: var(--fs-xs);
	letter-spacing: .1em;
}

.rp-stats {
	grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.rp-stats .stat .v {
	font-size: 17px;
}

.rp-mvp {
	margin: 8px 0 0;
	padding: 4px 8px;
	border: 1px solid var(--warn);
	color: var(--fg-hi);
}

.rp-mvp .rp-k {
	margin-right: 6px;
	padding: 0 4px;
	color: var(--bg);
	background: var(--warn);
}

.rp-mvp.dim {
	border-color: var(--line);
	color: var(--sub);
}

.rp-rank {
	width: 100%;
	margin-top: 8px;
	border-collapse: collapse;
	font-size: var(--fs-xs);
}

.rp-rank caption {
	color: var(--sub);
	text-align: left;
	padding-bottom: 2px;
}

.rp-rank th {
	color: var(--sub);
	font-weight: normal;
	text-align: left;
	border-bottom: 1px solid var(--line);
	padding: 2px 4px;
	white-space: nowrap;
}

.rp-rank td {
	padding: 2px 4px;
	border-bottom: 1px dotted var(--line);
}

.rp-rank td.num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.rp-rank td.dim {
	color: var(--muted);
}

.rp-rank tr[data-status="breached"] td:last-child {
	color: var(--alert-hi);
}

.rp-result-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

/* ============================================================ FX layer */

.rp-fx {
	position: absolute;
	inset: 0;
	z-index: 8;
	pointer-events: none;
	overflow: hidden;
}

/* ダメージなどの数値ポップ */
.rp-pop-n {
	position: absolute;
	transform: translate(-50%, -50%);
	color: var(--fg-hi);
	font-family: var(--mono);
	font-size: 17px;
	font-weight: bold;
	white-space: nowrap;
	text-shadow: 0 0 6px rgba(0, 0, 0, .9), 0 0 2px #000;
	animation: rp-float 1.05s ease-out both;
}

.rp-pop-n.atk { color: #ffffff; font-size: 19px; text-shadow: 0 0 8px rgba(127, 221, 87, .8), 0 0 2px #000; }
.rp-pop-n.burn { color: #ff5a4e; font-size: 24px; text-shadow: 0 0 10px rgba(255, 64, 64, .9), 0 0 2px #000; }
.rp-pop-n.trace { color: var(--warn); }
.rp-pop-n.heal,
.rp-pop-n.shield,
.rp-pop-n.scan { color: var(--cyan); font-size: 14px; }
.rp-pop-n.repair { color: var(--fg); font-size: 14px; }
.rp-pop-n.status { color: var(--st-c, #d78bff); font-size: 14px; }
.rp-pop-n.debuff { color: var(--warn); font-size: 13px; }
.rp-pop-n.run { color: var(--sub); font-size: 12px; font-weight: normal; }
.rp-pop-n.dim { color: var(--muted); font-size: 12px; }

/* 中央の帯 */
.rp-banner {
	position: absolute;
	--bn: 0;
	left: 0;
	right: 0;
	top: calc(30% + var(--bn) * 92px);
	display: grid;
	justify-items: center;
	gap: 2px;
	padding: 10px 8px;
	background: rgba(5, 0, 7, .82);
	border-top: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	color: var(--fg-hi);
	text-align: center;
	animation: rp-banner 1.2s ease-out both;
}

.rp-banner b {
	position: relative;
	font-family: var(--display);
	font-size: clamp(22px, 5vw, 40px);
	letter-spacing: .12em;
	line-height: 1.1;
}

.rp-banner b::before,
.rp-banner b::after {
	content: attr(data-t);
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.rp-banner b::before {
	color: rgba(255, 64, 64, .8);
	transform: translate(-3px, 0);
	clip-path: inset(0 0 55% 0);
	animation: rp-glitch-a .45s steps(3, end) 2;
}

.rp-banner b::after {
	color: rgba(111, 214, 232, .8);
	transform: translate(3px, 0);
	clip-path: inset(55% 0 0 0);
	animation: rp-glitch-b .45s steps(3, end) 2;
}

.rp-banner small {
	color: var(--sub);
	font-size: var(--fs-s);
	letter-spacing: .06em;
}

.rp-banner.breach { color: #ffffff; background: rgba(40, 0, 6, .86); border-color: var(--alert); }
.rp-banner.breach b { color: #fff; text-shadow: 0 0 12px rgba(255, 64, 64, .8); }
.rp-banner.alarm { color: var(--alert-hi); background: rgba(40, 0, 6, .86); }
.rp-banner.warn { color: var(--warn); }
.rp-banner.info { color: var(--cyan); }
.rp-banner.burn { color: var(--alert-hi); }

/* 全面のフラッシュ */
.rp-flash {
	position: absolute;
	inset: 0;
	animation: rp-flash .38s ease-out both;
}

.rp-flash.red { background: radial-gradient(ellipse at center, rgba(255, 64, 64, .16), rgba(255, 40, 40, .5)); }
.rp-flash.white { background: rgba(230, 255, 220, .55); }
.rp-flash.amber { background: radial-gradient(ellipse at center, rgba(232, 193, 90, .1), rgba(232, 193, 90, .38)); }
.rp-flash.cyan { background: radial-gradient(ellipse at center, rgba(127, 221, 87, .45), rgba(111, 214, 232, .2)); }
.rp-flash.status { box-shadow: inset 0 0 70px 12px var(--st-c, #d78bff); }
.rp-flash.whiteout { animation-name: rp-whiteout; }

.rp-noise {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	image-rendering: pixelated;
	mix-blend-mode: screen;
}

/* 決着 */
.rp-final {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 14px;
	padding: 16px;
	text-align: center;
	background: rgba(5, 0, 7, .82);
	animation: rp-final 2.6s ease both;
}

.rp-final-box {
	display: grid;
	justify-items: center;
	gap: 14px;
}

.rp-final-head {
	display: grid;
	gap: 4px;
}

.rp-final-head b {
	position: relative;
	font-family: var(--display);
	font-size: clamp(24px, 5.6vw, 46px);
	letter-spacing: .1em;
	line-height: 1.1;
}

.rp-final-head strong {
	font-size: clamp(20px, 4vw, 30px);
	letter-spacing: .3em;
}

.rp-final-head span {
	color: var(--sub);
	font-size: var(--fs-m);
}

.rp-final.burnout { color: #fff; background: radial-gradient(ellipse at center, rgba(255, 90, 70, .5), rgba(60, 0, 4, .6) 75%), rgba(16, 0, 3, .88); }
.rp-final.burnout .rp-final-head span { color: #ffd9d6; }
.rp-final.burnout b { text-shadow: 0 0 18px #ff4040, 0 0 4px #fff; }
.rp-final.trace { color: var(--alert-hi); background: radial-gradient(ellipse at center, rgba(255, 64, 64, .12), transparent 60%), rgba(18, 0, 4, .95); }
.rp-final.breach { color: var(--fg-hi); background: radial-gradient(ellipse at 50% 85%, rgba(127, 221, 87, .3), rgba(5, 0, 7, .6) 70%), rgba(5, 0, 7, .5); }
.rp-final.timeout { color: var(--warn); background: repeating-linear-gradient(0deg, rgba(5, 0, 7, .92) 0 2px, rgba(30, 24, 6, .92) 2px 4px); }

.rp-final-term {
	margin: 0;
	min-height: 6.4em;
	color: var(--alert-hi);
	font-size: var(--fs-s);
	text-align: left;
	white-space: pre;
}

.rp-reticle {
	position: relative;
	width: 120px;
	height: 120px;
	border: 2px solid var(--alert);
	border-radius: 50%;
	animation: rp-reticle 1.2s ease-out both;
}

.rp-reticle i {
	position: absolute;
	background: var(--alert);
}

.rp-reticle i:nth-child(1) { left: 50%; top: -14px; bottom: -14px; width: 1px; }
.rp-reticle i:nth-child(2) { top: 50%; left: -14px; right: -14px; height: 1px; }
.rp-reticle i:nth-child(3) { left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: none; border: 2px solid var(--alert-hi); }

/* ============================================================ FX classes on board parts */

.rp-fx-shake { animation: rp-shake .36s linear; }
.rp-fx-shake2 { animation: rp-shake2 .6s linear; }

.rp-layer.rp-fx-target { outline: 2px solid var(--fg-hi); outline-offset: 1px; }
.rp-layer.rp-fx-charge { outline: 2px dashed var(--warn); outline-offset: 3px; animation: rp-charge .7s ease-in-out; }
.rp-layer.rp-fx-hit { animation: rp-jolt .3s ease-out; }
.rp-layer.rp-fx-breaking { animation: rp-breaking 1s steps(1, end) both, rp-breaking-t 1s ease-out; }
.rp-layer.rp-fx-enter { animation: rp-enter .7s ease-out; }
.rp-layer.rp-fx-shield { animation: rp-shield .7s ease-out; }
.rp-layer.rp-fx-repair { animation: rp-repair .8s ease-out; }
.rp-layer.rp-fx-spawn { animation: rp-spawn .9s cubic-bezier(.2, .8, .2, 1) both; }
.rp-layer.rp-fx-cloak { animation: rp-cloak .9s ease-out; }
.rp-layer.rp-fx-scan::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(180deg, transparent 0, rgba(111, 214, 232, .45) 50%, transparent 100%) no-repeat;
	background-size: 100% 40%;
	animation: rp-scanline .9s linear both;
}

.rp-mod.rp-fx-scan { animation: rp-reveal .9s steps(9, end) both; border-color: var(--cyan); }
.rp-mod.rp-fx-scan::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 0, rgba(111, 214, 232, .6) 50%, transparent 100%) no-repeat;
	background-size: 100% 50%;
	animation: rp-scanline .9s linear both;
}

.rp-mod.rp-fx-fire,
.rp-layer.rp-fx-fire,
.rp-core.rp-fx-fire {
	animation: rp-fire .7s ease-out;
}

.rp-core.rp-fx-scan { animation: rp-shield .9s ease-out; }
.rp-core.rp-fx-coreopen { animation: rp-coreopen 1.6s ease-out both; }

.rp-hud.rp-fx-hurt { animation: rp-hurt .7s ease-out; }

.rp-st.rp-fx-pop { animation: rp-pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.rp-gauge.rp-fx-dmg .rp-g-bar { animation: rp-gdmg .5s ease-out; }
.rp-gauge.rp-fx-blip,
.rp-turn.rp-fx-blip { animation: rp-blip .42s ease-out; }
.rp-gauge.rp-fx-alarm .rp-g-bar { animation: rp-alarm .4s steps(2, end) 4; }

/* ============================================================ keyframes */

@keyframes rp-float {
	0% { opacity: 0; transform: translate(-50%, -30%) scale(.8); }
	12% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
	30% { transform: translate(-50%, -60%) scale(1); }
	100% { opacity: 0; transform: translate(-50%, -150%); }
}

@keyframes rp-banner {
	0% { opacity: 0; transform: scaleY(0); }
	8% { opacity: 1; transform: scaleY(1.15); }
	14% { transform: scaleY(1); }
	82% { opacity: 1; }
	100% { opacity: 0; }
}

@keyframes rp-glitch-a {
	0% { transform: translate(-4px, 0); clip-path: inset(0 0 60% 0); }
	50% { transform: translate(3px, 1px); clip-path: inset(30% 0 40% 0); }
	100% { transform: translate(0, 0); clip-path: inset(0 0 100% 0); }
}

@keyframes rp-glitch-b {
	0% { transform: translate(4px, 0); clip-path: inset(60% 0 0 0); }
	50% { transform: translate(-3px, -1px); clip-path: inset(20% 0 50% 0); }
	100% { transform: translate(0, 0); clip-path: inset(100% 0 0 0); }
}

@keyframes rp-flash {
	0% { opacity: 0; }
	15% { opacity: 1; }
	100% { opacity: 0; }
}

@keyframes rp-whiteout {
	0% { opacity: 0; background: rgba(255, 64, 64, .7); }
	20% { opacity: 1; background: rgba(255, 64, 64, .85); }
	45% { opacity: 1; background: rgba(255, 245, 240, .97); }
	100% { opacity: 0; background: rgba(255, 245, 240, .9); }
}

@keyframes rp-final {
	0% { opacity: 0; }
	8% { opacity: 1; }
	85% { opacity: 1; }
	100% { opacity: 0; }
}

@keyframes rp-reticle {
	0% { transform: scale(2.4); opacity: 0; }
	60% { transform: scale(.92); opacity: 1; }
	75% { transform: scale(1.05); }
	100% { transform: scale(1); }
}

@keyframes rp-shake {
	0%, 100% { transform: translate(0, 0); }
	20% { transform: translate(-4px, 1px); }
	40% { transform: translate(4px, -2px); }
	60% { transform: translate(-3px, 2px); }
	80% { transform: translate(2px, -1px); }
}

@keyframes rp-shake2 {
	0%, 100% { transform: translate(0, 0); }
	10% { transform: translate(-8px, 3px) skewX(-2deg); }
	20% { transform: translate(7px, -4px) skewX(2deg); }
	30% { transform: translate(-6px, 2px); }
	45% { transform: translate(5px, 3px) skewX(-1deg); }
	60% { transform: translate(-4px, -2px); }
	80% { transform: translate(2px, 1px); }
}

@keyframes rp-jolt {
	0% { transform: translateX(0); filter: brightness(1.8); }
	30% { transform: translateX(4px); }
	60% { transform: translateX(-3px); }
	100% { transform: translateX(0); filter: none; }
}

@keyframes rp-breaking {
	0% { filter: brightness(2.4) saturate(0); clip-path: inset(0 0 0 0); }
	12% { filter: brightness(1.4) hue-rotate(-60deg); clip-path: inset(0 0 52% 0); }
	20% { clip-path: inset(48% 0 0 0); }
	28% { clip-path: polygon(0 0, 100% 0, 100% 30%, 70% 45%, 100% 60%, 100% 100%, 0 100%, 0 70%, 25% 50%, 0 35%); }
	44% { filter: brightness(.7) hue-rotate(-60deg); clip-path: polygon(0 0, 46% 0, 54% 30%, 40% 55%, 58% 100%, 0 100%); }
	52% { clip-path: polygon(54% 0, 100% 0, 100% 100%, 62% 100%, 46% 55%, 60% 30%); }
	64% { filter: brightness(.6); clip-path: inset(0 0 0 0); }
	100% { filter: none; clip-path: inset(0 0 0 0); }
}

@keyframes rp-breaking-t {
	0% { transform: none; }
	15% { transform: translateX(-6px) skewX(6deg); }
	30% { transform: translateX(5px) skewX(-8deg); }
	45% { transform: translateY(3px) scaleY(.94); }
	100% { transform: none; }
}

@keyframes rp-enter {
	0% { box-shadow: 0 0 0 0 rgba(127, 221, 87, .8); }
	100% { box-shadow: 0 0 0 10px rgba(127, 221, 87, 0); }
}

@keyframes rp-charge {
	0%, 100% { outline-color: var(--warn); }
	50% { outline-color: var(--alert); }
}

@keyframes rp-shield {
	0% { box-shadow: inset 0 0 0 0 rgba(111, 214, 232, 0); }
	30% { box-shadow: inset 0 0 18px 3px rgba(111, 214, 232, .7); }
	100% { box-shadow: inset 0 0 0 0 rgba(111, 214, 232, 0); }
}

@keyframes rp-repair {
	0% { box-shadow: inset 0 0 0 0 rgba(127, 221, 87, 0); }
	30% { box-shadow: inset 0 0 18px 3px rgba(127, 221, 87, .7); }
	100% { box-shadow: inset 0 0 0 0 rgba(127, 221, 87, 0); }
}

@keyframes rp-spawn {
	0% { opacity: 0; transform: scaleY(.1); border-color: var(--cyan); filter: brightness(2); }
	40% { opacity: 1; transform: scaleY(1.06); }
	100% { opacity: 1; transform: none; filter: none; }
}

@keyframes rp-cloak {
	0% { filter: none; }
	30% { filter: blur(3px) contrast(2) hue-rotate(80deg); opacity: .4; }
	100% { filter: none; opacity: 1; }
}

@keyframes rp-scanline {
	0% { background-position: 0 -60%; }
	100% { background-position: 0 160%; }
}

@keyframes rp-reveal {
	0% { clip-path: inset(0 0 100% 0); }
	100% { clip-path: inset(0 0 0 0); }
}

@keyframes rp-fire {
	0% { background-color: rgba(255, 64, 64, .55); box-shadow: 0 0 14px 2px rgba(255, 64, 64, .7); border-color: var(--alert); }
	100% { box-shadow: 0 0 0 0 rgba(255, 64, 64, 0); }
}

@keyframes rp-coreopen {
	0% { box-shadow: 0 0 0 0 rgba(127, 221, 87, 0); }
	40% { box-shadow: 0 0 40px 10px rgba(127, 221, 87, .7); }
	100% { box-shadow: 0 0 18px 2px rgba(127, 221, 87, .35); }
}

@keyframes rp-hurt {
	0% { border-color: var(--alert); box-shadow: inset 0 0 30px rgba(255, 64, 64, .55), 0 0 14px rgba(255, 64, 64, .5); }
	100% { border-color: var(--line-hi); box-shadow: none; }
}

@keyframes rp-pop {
	0% { transform: scale(0); box-shadow: 0 0 0 0 var(--sc); }
	60% { transform: scale(1.35); box-shadow: 0 0 12px 3px var(--sc); }
	100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; }
}

@keyframes rp-gdmg {
	0% { background: rgba(255, 64, 64, .8); transform: translateX(-3px); }
	30% { transform: translateX(3px); }
	100% { background: #050007; transform: none; }
}

@keyframes rp-blip {
	0% { filter: brightness(2.2); }
	100% { filter: none; }
}

@keyframes rp-alarm {
	0% { background: rgba(255, 64, 64, .7); }
	100% { background: #050007; }
}

@keyframes rp-blink-border {
	0% { border-color: var(--alert); }
	100% { border-color: var(--line); }
}

@keyframes rp-cursor {
	0% { opacity: 1; }
	100% { opacity: 0; }
}

/* ============================================================ PC: こちら側(HUD)は固定・相手の防壁の層は独立してスクロール
   (2026-11-22 制作者の指摘②)。相手の防壁の層が多いと、演算力・安定度・状態が画面外へ流れていた。
   HUD(.rp-hud)はスクロールの外に置き、層の列(.rp-dive)だけが縦にスクロールする。割った層は上へ流れ、
   いまの層が見える位置に来る(replay/player.js の alignDive。手でさかのぼってもよい)。760px 未満(スマホ)は従来どおり全体が縦に流れる */
@media (min-width: 760px) {
	.rp-scroll {
		display: flex;
		flex-direction: column;
		overflow: hidden;
	}

	.rp-board {
		display: flex;
		flex-direction: column;
		flex: 1 1 auto;
		min-height: 0;
	}

	.rp-hud {
		flex: none;
	}

	.rp-dive {
		flex: 1 1 auto;
		min-height: 0;
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		margin-inline: -6px;
		padding: 2px 6px 12px;
		scrollbar-gutter: stable;
	}
}

/* 低い PC の画面: HUD を2段に畳んで、相手の防壁の領域を残す(ターン・名前と状態異常を1行に、安定度と逆探知を横に並べる) */
@media (min-width: 760px) and (max-height: 780px) {
	.rp-hud {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 3px 14px;
		padding: 5px 10px;
	}

	.rp-hud-top {
		grid-column: 1 / -1;
	}

	.rp-hud .rp-gauge {
		grid-template-columns: auto minmax(0, 1fr) 3.8em;
		gap: 6px;
		margin: 0;
	}

	.rp-hud .rp-statuses {
		min-height: 0;
		margin: 0;
		align-self: center;
	}
}

/* ============================================================ responsive */

@media (max-width: 1100px) {
	.rp-main {
		grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr);
	}
}

@media (max-width: 759px) {
	.rp-dialog {
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		border: 0;
	}

	.rp {
		display: block;
		height: 100%;
		overflow-x: hidden;
		overflow-y: auto;
	}

	.rp-head .band {
		flex-wrap: wrap;
		row-gap: 0;
	}

	.rp-head .band .rp-meta {
		margin-left: 0;
		flex: 1 1 100%;
		white-space: normal;
	}

	.rp-controls {
		position: sticky;
		top: 0;
		z-index: 12;
		gap: 6px 8px;
		padding: 6px 8px;
	}

	.rp-transport {
		width: 100%;
		justify-content: space-between;
	}

	.rp .btn.sm.rp-c {
		padding: 3px 4px;
		font-size: 11px;
	}

	.rp .btn.sm.rp-c::before,
	.rp .btn.sm.rp-c::after {
		content: none;
	}

	.rp .btn.sm.rp-play {
		min-width: 6em;
	}

	.rp-seekwrap {
		flex-basis: 100%;
	}

	.rp-main {
		display: block;
	}

	.rp-stage {
		border-right: 0;
		border-bottom: 1px solid var(--line);
	}

	.rp-scroll {
		height: auto;
		overflow: visible;
		padding: 8px 8px 12px;
	}

	.rp-logcol {
		overflow: visible;
		padding: 8px;
	}

	.rp-result,
	.rp-logbox {
		scroll-margin-top: 200px; /* 上に貼り付く操作列(+今の手)の下から見せる */
	}

	.rp-log {
		max-height: 55vh;
	}

	.rp-layer {
		margin-inline: calc(var(--d) * 4px);
	}

	.rp-gauge {
		grid-template-columns: 6.6em minmax(0, 1fr) 4.4em;
		gap: 6px;
	}

	.rp-banner {
		top: calc(110px + var(--bn) * 84px);
	}

	.rp-final {
		place-content: start center;
		padding-top: 90px;
	}

	/* 決着の文字: 見えている範囲に不透明な帯で出す(HUD と重ならない。位置は player.js の finaleY) */
	.rp-final.is-band {
		display: block;
		padding: 0;
	}

	.rp-final.is-band .rp-final-box {
		position: absolute;
		left: 0;
		right: 0;
		top: var(--fy, 50%);
		transform: translateY(-50%);
		gap: 10px;
		padding: 16px 12px;
		background: #050007;
		border-top: 1px solid currentColor;
		border-bottom: 1px solid currentColor;
	}

	.rp-final.is-band.burnout .rp-final-box { background: #2a0306; }
	.rp-final.is-band.trace .rp-final-box { background: #120004; }

	.rp-final.is-band .rp-reticle {
		width: 72px;
		height: 72px;
	}

	.rp-final.is-band .rp-final-term {
		min-height: 0;
		font-size: var(--fs-xs);
	}

	/* 今の手: 操作列(上に貼り付く)の直下に固定の高さで出す */
	.rp-caption {
		display: block;
		position: relative;
		flex: 1 1 100%;
		height: calc(5 * 1.4em + 8px);
		margin: 0 -8px -6px;
		padding: 4px 8px;
		overflow: hidden;
		font-size: 11.5px;
		line-height: 1.4;
		background: var(--bg);
		border-top: 1px dotted var(--line);
		cursor: pointer;
	}

	.rp-caption[data-big="breach"] { box-shadow: inset 3px 0 0 var(--alert); }
	.rp-caption[data-big="alarm"] { box-shadow: inset 3px 0 0 var(--alert-hi); }
	.rp-caption[data-big="result"] { box-shadow: inset 3px 0 0 var(--warn); }

	.rp-caption .rp-ln {
		padding-left: 0;
		text-indent: 0;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		margin: 0;
	}

	.rp-caption .rp-ln.k-breach {
		padding: 0 4px;
	}

	.rp-cap-no {
		position: absolute;
		right: 8px;
		top: 4px;
		padding-left: 6px;
		color: var(--muted);
		font-size: 10px;
		background: var(--bg);
	}

	.rp-cap-no + .rp-ln {
		padding-right: 5.4em; /* 右上の手番号と重ねない */
	}

	.rp-cap-more {
		display: block;
		color: var(--sub);
		font-size: 10.5px;
	}

	.rp-rank.rp-layers th:nth-child(8),
	.rp-rank.rp-layers td:nth-child(8) {
		display: none;
	}
}

/* ============================================================ 戦闘の構図(replay/duel.js)
   侵入者(左)と防壁(右)が向き合う横長の帯。広い画面では詳細ログの上、狭い画面では盤面の上(操作列の下に貼り付く)。
   絵は等倍の GIF を整数倍に拡大(--k)。「文字だけ」の設定では帯ごと出さない。 */

.rp.has-duel .rp-main {
	grid-template-rows: auto minmax(0, 1fr);
}

.rp.has-duel .rp-stage {
	grid-column: 1;
	grid-row: 1 / span 2;
}

.rp.has-duel .rp-duel {
	grid-column: 2;
	grid-row: 1;
}

.rp.has-duel .rp-logcol {
	grid-column: 2;
	grid-row: 2;
}

html:not(.kb-arts) .rp-duel,
html:not(.kb-arts) .rp-duel-edge {
	display: none;
}

.rp-duel {
	--k: 2;
	--a: calc(48px * var(--k));
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 10px 12px 0;
	padding: 6px 8px;
	overflow: hidden;
	border: 1px solid var(--line);
	background:
		repeating-linear-gradient(0deg, rgba(127, 221, 87, .035) 0 1px, transparent 1px 3px),
		linear-gradient(90deg, rgba(111, 214, 232, .08), transparent 35%, transparent 65%, rgba(255, 64, 64, .08));
	line-height: 1.3;
	user-select: none;
}

.rp-duel-side {
	position: relative;
	z-index: 1;
	display: flex;
	flex: 0 1 auto;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.rp-duel-side.is-foe {
	flex-direction: row-reverse;
	text-align: right;
}

.rp-duel-art {
	position: relative;
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: var(--a);
	height: var(--a);
	overflow: hidden;
	outline: 1px solid var(--line-hi);
	background: var(--bg-deep);
}

.rp-duel-side.is-me .rp-duel-art { outline-color: rgba(111, 214, 232, .55); }
.rp-duel-side.is-foe .rp-duel-art { outline-color: rgba(255, 64, 64, .55); }

/* 絵(当直端末・汎用の防壁・カードの絵)。整数倍・pixelated */
.rp-duel-px,
.rp-duel-px > img,
.rp-duel-px > canvas {
	display: block;
	width: var(--a);
	height: var(--a);
	image-rendering: pixelated;
	image-rendering: crisp-edges;
}

.rp-duel-px > img.is-hold { visibility: hidden; }

.rp-duel .kb-art.rp-duel-card {
	width: var(--a);
	height: var(--a);
}

.rp-duel .kb-art.rp-duel-card .kb-art-img {
	width: 100%;
	height: 100%;
}

/* 作戦記録のボスの絵(128×128 ×1)。帯の高さに合わせて中央を切り出す(縮めない) */
.rp-duel.has-boss .is-foe .rp-duel-art {
	width: 128px;
	height: 112px;
}

.rp-duel .ops-boss {
	--bw: 128px;
	display: block;
	flex: none;
}

.rp-duel .ops-boss .ops-art { --k: 1; outline: 0; }
.rp-duel .ops-boss figcaption { display: none; }

.rp-duel .ops-boss-copy {
	left: auto;
	top: auto;
	right: 2px;
	bottom: 10px;
}

.rp-duel .ops-boss.is-enraged .ops-art { box-shadow: none; }
.rp-duel.has-boss .is-foe:has(.is-enraged) .rp-duel-art { outline: 2px solid var(--alert); }

.rp-duel-plate {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.rp-duel-nm {
	overflow: hidden;
	color: var(--fg-hi);
	font-size: var(--fs-s);
	white-space: nowrap;
	text-overflow: ellipsis;
}

.rp-duel-side.is-foe .rp-duel-nm { color: var(--alert-hi); }

.rp-duel-sub {
	color: var(--sub);
	font-size: var(--fs-xs);
	white-space: nowrap;
}

.rp-duel-side.is-low .rp-duel-sub { color: var(--alert-hi); }

/* 間の通路(弾が飛ぶところ) */
.rp-duel-lane {
	position: relative;
	display: flex;
	flex: 1 1 24px;
	align-items: center;
	justify-content: center;
	align-self: stretch;
	min-width: 16px;
}

.rp-duel-rail {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 0;
	border-top: 1px dashed var(--line-hi);
}

.rp-duel-vs {
	position: relative;
	padding: 0 4px;
	color: var(--muted);
	font-size: var(--fs-xs);
	letter-spacing: .1em;
	background: var(--bg);
}

.rp-duel[data-result="win"] .is-foe .rp-duel-art { filter: grayscale(.8) brightness(.55); }
.rp-duel[data-result="lose"] .is-me .rp-duel-art { filter: grayscale(.8) brightness(.55); }

/* 演出の層 */
.rp-duel-fx {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	overflow: hidden;
}

/* 弾・光の線・走査(左 → 右 / 右 → 左) */
.rp-duel-shot {
	position: absolute;
	top: 50%;
	left: 0;
	width: 14px;
	height: 4px;
	margin-top: -2px;
	border-radius: 2px;
	background: var(--cyan);
	box-shadow: 0 0 6px 2px rgba(111, 214, 232, .8);
	animation: rp-duel-lr .28s linear both;
}

.rp-duel-shot.d-rl { animation-name: rp-duel-rl; }
.rp-duel-shot.k-shot { background: #fff; box-shadow: 0 0 8px 2px rgba(169, 238, 248, .9); }
.rp-duel-shot.k-burn { width: 18px; height: 6px; margin-top: -3px; background: #ff7a4e; box-shadow: 0 0 10px 3px rgba(255, 64, 64, .9); }
.rp-duel-shot.k-trace { width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: transparent; border: 2px solid var(--warn); box-shadow: 0 0 8px rgba(232, 193, 90, .8); }
.rp-duel-shot.k-status { width: 9px; height: 9px; margin-top: -4px; border-radius: 50%; background: #d78bff; box-shadow: 0 0 8px 2px rgba(215, 139, 255, .8); }

/* 光の線: 左の端から伸びて右に届く */
.rp-duel-shot.k-beam {
	left: 12%;
	width: 76%;
	height: 2px;
	margin-top: -1px;
	transform-origin: left center;
	background: linear-gradient(90deg, rgba(111, 214, 232, .2), var(--cyan));
	animation-name: rp-duel-beam;
}

@keyframes rp-duel-lr {
	0% { left: 10%; opacity: 0; }
	10% { opacity: 1; }
	100% { left: 86%; opacity: 1; }
}

@keyframes rp-duel-rl {
	0% { left: 86%; opacity: 0; }
	10% { opacity: 1; }
	100% { left: 10%; opacity: 1; }
}

@keyframes rp-duel-beam {
	0% { transform: scaleX(0); opacity: 1; }
	70% { transform: scaleX(1); opacity: 1; }
	100% { transform: scaleX(1); opacity: 0; }
}

/* 数値・短い文字 */
.rp-duel-pop {
	position: absolute;
	top: calc(46% - var(--n, 0) * 15px);
	z-index: 4;
	color: var(--fg-hi);
	font-family: var(--mono);
	font-size: 16px;
	font-weight: bold;
	white-space: nowrap;
	text-shadow: 0 0 5px #000, 0 0 2px #000;
	transform: translate(-50%, -50%);
	animation: rp-float 1.05s ease-out both;
}

.rp-duel-pop.at-me { left: calc(8px + var(--a) / 2); }
.rp-duel-pop.at-foe { left: calc(100% - 8px - var(--a) / 2); }
.rp-duel.has-boss .rp-duel-pop.at-foe { left: calc(100% - 8px - 64px); }
.rp-duel-pop.is-atk { color: #fff; font-size: 18px; text-shadow: 0 0 8px rgba(127, 221, 87, .9), 0 0 2px #000; }
.rp-duel-pop.is-burn { color: #ff5a4e; font-size: 20px; text-shadow: 0 0 9px rgba(255, 64, 64, .9), 0 0 2px #000; }
.rp-duel-pop.is-trace { color: var(--warn); font-size: 13px; }
.rp-duel-pop.is-heal,
.rp-duel-pop.is-shield { color: var(--cyan); font-size: 13px; }
.rp-duel-pop.is-repair { color: var(--fg); font-size: 13px; }
.rp-duel-pop.is-status { color: #d78bff; font-size: 12px; }
.rp-duel-pop.is-debuff { color: var(--alert-hi); font-size: 12px; }
.rp-duel-pop.is-breach { color: var(--fg-hi); font-size: 18px; letter-spacing: .1em; text-shadow: 0 0 10px rgba(127, 221, 87, .9), 0 0 2px #000; }

/* 絵の反応(被弾で揺れる・点滅、走査、守り、回復など) */
.rp-duel-side.is-shake { animation: rp-duel-shake .34s linear; }
.rp-duel-side.is-shake2 { animation: rp-duel-shake2 .54s linear; }
.rp-duel-side.is-hit .rp-duel-art,
.rp-duel-side.is-hurt .rp-duel-art { animation: rp-duel-blink .38s steps(2, end) 1; }
.rp-duel-side.is-hurt .rp-duel-art { box-shadow: 0 0 0 2px var(--alert), 0 0 14px rgba(255, 64, 64, .7); }
.rp-duel-side.is-cast .rp-duel-art { box-shadow: 0 0 0 2px var(--cyan); }
.rp-duel-side.is-buff .rp-duel-art,
.rp-duel-side.is-heal .rp-duel-art { box-shadow: 0 0 0 2px var(--fg), 0 0 14px rgba(127, 221, 87, .6); }
.rp-duel-side.is-ward .rp-duel-art,
.rp-duel-side.is-guard .rp-duel-art { box-shadow: 0 0 0 2px var(--cyan), 0 0 14px rgba(111, 214, 232, .6); }
.rp-duel-side.is-repair .rp-duel-art { box-shadow: 0 0 0 2px var(--fg); }
.rp-duel-side.is-cloak .rp-duel-art { opacity: .45; transition: opacity .2s; }
.rp-duel-side.is-status .rp-duel-art { box-shadow: 0 0 0 2px #d78bff, 0 0 14px rgba(215, 139, 255, .6); }
.rp-duel-side.is-traced .rp-duel-art,
.rp-duel-side.is-track .rp-duel-art { box-shadow: 0 0 0 2px var(--warn), 0 0 12px rgba(232, 193, 90, .6); }
.rp-duel-side.is-fire .rp-duel-art { box-shadow: 0 0 0 2px var(--alert), 0 0 12px rgba(255, 64, 64, .7); }
.rp-duel-side.is-break .rp-duel-art { animation: rp-duel-break .9s steps(6, end) 1; }
.rp-duel-side.is-enter .rp-duel-art { animation: rp-duel-enter .5s ease-out 1; }
.rp-duel-side.is-spawn .rp-duel-art { box-shadow: 0 0 0 2px var(--alert-hi); }

/* 走査線(上から下へ) */
.rp-duel-art::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -4px;
	height: 3px;
	opacity: 0;
	background: var(--cyan);
	box-shadow: 0 0 8px 2px rgba(111, 214, 232, .8);
	pointer-events: none;
}

.rp-duel-side.is-scan .rp-duel-art::after { animation: rp-duel-scan .75s linear 1; }

@keyframes rp-duel-shake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-3px); }
	40% { transform: translateX(3px); }
	60% { transform: translateX(-2px); }
	80% { transform: translateX(2px); }
}

@keyframes rp-duel-shake2 {
	0%, 100% { transform: translate(0, 0); }
	12% { transform: translate(-5px, 1px); }
	25% { transform: translate(5px, -1px); }
	37% { transform: translate(-4px, 0); }
	50% { transform: translate(4px, 1px); }
	62% { transform: translate(-3px, -1px); }
	75% { transform: translate(2px, 0); }
	87% { transform: translate(-1px, 0); }
}

@keyframes rp-duel-blink {
	0% { filter: brightness(2.6) saturate(.4); }
	100% { filter: none; }
}

@keyframes rp-duel-break {
	0% { filter: brightness(2.5); clip-path: inset(0); }
	30% { filter: hue-rotate(90deg) brightness(1.6); clip-path: inset(10% 0 30% 0); }
	60% { filter: invert(1); clip-path: inset(40% 0 5% 0); }
	100% { filter: none; clip-path: inset(0); }
}

@keyframes rp-duel-enter {
	0% { opacity: 0; transform: translateX(12px); }
	100% { opacity: 1; transform: none; }
}

@keyframes rp-duel-scan {
	0% { top: -4px; opacity: 1; }
	90% { opacity: 1; }
	100% { top: 100%; opacity: 0; }
}

/* 被弾: 画面の端が赤く明滅する(body の直下に一時的に置く) */
.rp-duel-edge {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	pointer-events: none;
	box-shadow: inset 0 0 calc(18px + var(--s, 1) * 14px) calc(2px + var(--s, 1) * 4px) rgba(255, 40, 40, .8);
	animation: rp-duel-edge .6s steps(4, end) both;
}

.rp-duel-edge.k-amber { box-shadow: inset 0 0 28px 4px rgba(232, 193, 90, .7); }

@keyframes rp-duel-edge {
	0% { opacity: 0; }
	25% { opacity: 1; }
	50% { opacity: .25; }
	75% { opacity: .9; }
	100% { opacity: 0; }
}

@media (max-width: 1100px) {
	.rp-duel { --k: 1; }
	.rp-duel.has-boss .is-foe .rp-duel-art { width: 112px; height: 72px; }
}

/* 狭い画面: 盤面の上、操作列の下に貼り付く(弾と被弾が盤面を送っても見える)。絵は ×1、ボスは中央を切り出す */
@media (max-width: 759px) {
	.rp-duel {
		--k: 1;
		position: sticky;
		top: var(--rp-ctl-h, 0px);
		z-index: 11;
		margin: 0;
		padding: 4px 8px;
		border-width: 0 0 1px;
		background-color: var(--bg);
	}

	.rp-duel.has-boss .is-foe .rp-duel-art { width: 96px; height: 56px; }
	.rp-duel.has-boss .rp-duel-pop.at-foe { left: calc(100% - 8px - 48px); }
	.rp-duel-nm { font-size: var(--fs-xs); }
	.rp-duel-sub { font-size: 10px; }
	.rp-duel-vs { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.rp-duel-shot,
	.rp-duel-edge {
		display: none;
	}

	.rp-duel-pop {
		transform: translate(-50%, -60%);
	}
}

/* ============================================================ reduced motion: 揺れ・点滅・浮き上がりを止める */

@media (prefers-reduced-motion: reduce) {
	.rp *,
	.rp *::before,
	.rp *::after {
		animation: none !important;
		transition: none !important;
	}

	.rp-pop-n {
		transform: translate(-50%, -110%);
	}

	.rp-flash {
		opacity: .45;
	}

	.rp-flash.whiteout {
		background: rgba(255, 64, 64, .45);
	}

	.rp-here {
		opacity: 1;
	}
}

/* ============================================================ ヘッダーの重なり順(帯域の説明などを開いている間。auth/stamina.js)
   音のスイッチ(.snd-sw)は設定ページ(settings.html)へ移した(2026-11-11)。 */

.snd-raised {
	z-index: 70;
}


/* ============================================================ 保管庫の演出(解体・打ち直し。docs/fx-design.md §12)
   assets/js/ops/vault-fx.js が付ける。解体 = 走査線で絵が崩れて粒になり、断片の数字へ吸われる。
   打ち直し = 付加効果の行が回って確定し、良くなった(緑)/ 悪くなった(琥珀)/ 変わらずで色が付く。
   演出中は .vx-layer(透明の全面)が入力を受ける(二重押し防止・タップでスキップ)。 */

.vx-layer {
	position: fixed;
	inset: 0;
	z-index: 90;
	overflow: hidden;
	background: transparent;
	cursor: pointer;
	touch-action: manipulation;
}

/* 粒(解体)と走査線 */
.vx-p {
	position: fixed;
	display: block;
	pointer-events: none;
	box-shadow: 0 0 4px currentColor;
	image-rendering: pixelated;
}

.vx-scan {
	position: fixed;
	display: block;
	height: 2px;
	background: var(--fg-hi);
	box-shadow: 0 0 6px var(--fg), 0 0 14px var(--fg);
	pointer-events: none;
}

.vx-crumble {
	animation: vx-crumble .42s steps(10, end) forwards;
	pointer-events: none;
}

@keyframes vx-crumble {
	0% { clip-path: inset(0 0 0 0); filter: none; }
	25% { filter: brightness(1.7) saturate(.4); }
	100% { clip-path: inset(100% 0 0 0); filter: brightness(2.2) saturate(0); }
}

/* 断片の数字(吸われている間の脈動と、増えた分の表示) */
.vx-pulse {
	display: inline-block;
	color: var(--fg-hi);
	text-shadow: 0 0 8px var(--fg);
	animation: vx-pulse .5s ease-out;
}

@keyframes vx-pulse {
	0% { transform: scale(1); }
	30% { transform: scale(1.35); }
	100% { transform: scale(1); }
}

.vx-plus {
	position: fixed;
	z-index: 1;
	color: var(--fg-hi);
	font-size: var(--fs-m);
	pointer-events: none;
	text-shadow: 0 0 6px var(--fg);
	animation: vx-plus .8s ease-out forwards;
}

@keyframes vx-plus {
	0% { transform: translate(14px, -4px); opacity: 0; }
	20% { opacity: 1; }
	100% { transform: translate(14px, -26px); opacity: 0; }
}

/* 数字が画面の外のときの、上端の小さな表示 */
.vx-hud {
	position: fixed;
	top: 10px;
	left: 50%;
	display: flex;
	gap: 8px;
	align-items: baseline;
	padding: 4px 12px;
	background: var(--bg-deep);
	border: 1px solid var(--fg);
	transform: translateX(-50%);
	pointer-events: none;
}

.vx-hud b { color: var(--fg-hi); font-size: var(--fs-l); }

/* 打ち直し: 回っている行・確定の瞬間・判定の色 */
.x-ax-t.vx-spinning,
.x-ax-n.vx-spinning {
	color: var(--warn);
	text-shadow: 0 0 6px var(--warn);
	animation: vx-reel .12s steps(2, end) infinite;
}

@keyframes vx-reel {
	0% { opacity: .55; }
	100% { opacity: 1; }
}

li.vx-roll { background: var(--bg-2); box-shadow: inset 2px 0 0 var(--warn); }
li.vx-lock { animation: vx-lock .42s ease-out; }

@keyframes vx-lock {
	0% { background: rgba(166, 240, 138, .45); }
	100% { background: transparent; }
}

li.vx-lock.vx-down { animation-name: vx-lock-down; }

@keyframes vx-lock-down {
	0% { background: rgba(232, 193, 90, .4); }
	100% { background: transparent; }
}

li.vx-up .x-ax-t { color: var(--fg-hi); }
li.vx-down .x-ax-t { color: var(--wet); }
li.vx-up::after { content: " ▲"; color: var(--fg-hi); }
li.vx-down::after { content: " ▼"; color: var(--wet); }

.vx-glow { animation: vx-glow .52s ease-out; }
.vx-glow.x-t3 { --vx-c: var(--tier-t3); }
.vx-glow.x-t4 { --vx-c: var(--tier-t4); }

@keyframes vx-glow {
	0% { box-shadow: 0 0 0 0 var(--vx-c, var(--fg)); }
	40% { box-shadow: 0 0 14px 2px var(--vx-c, var(--fg)); }
	100% { box-shadow: 0 0 0 0 transparent; }
}

@media (prefers-reduced-motion: reduce) {
	.vx-crumble,
	.vx-pulse,
	.vx-plus,
	.x-ax-t.vx-spinning,
	.x-ax-n.vx-spinning,
	li.vx-lock,
	.vx-glow {
		animation: none !important;
	}
}
