/* はつめいロボバトルDX — transition.css：画面の切り替え演出（js/transition.js）。2026-12-02 新規
   動かすのは transform と opacity だけ（重い 3D の作り直しの最中も、なめらかに動くように）。
   決めごと：左だけ太い色線は使わない・絵文字は使わない・押したボタンを光らせない */

#scr-tr {
  position: fixed;
  inset: 0;
  z-index: 1000; /* メニュー・モーダル（〜300）より上、横向き案内（orient.js）より下 */
  overflow: hidden;
  pointer-events: none;
  contain: strict;
  -webkit-user-select: none;
  user-select: none;
}
#scr-tr[hidden],
#tr-flash[hidden] { display: none !important; }
/* 覆っているあいだだけ押せなくする（二重押しで裏のボタンを押さない） */
#scr-tr.is-blocking { pointer-events: auto; touch-action: none; cursor: progress; }

.tr-view { position: absolute; inset: 0; display: none; }
.tr-view.is-on { display: block; }

/* ---------- シャッター（ガレージに入る・出る）：js/garage-art.js の奥の壁のシャッターと同じ色 ---------- */
.tr-shutter { --slat: clamp(22px, 3.6vh, 34px); --bar: clamp(26px, 4.4vh, 40px); }
.tr-sh-curtain {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  transform: translate3d(0, -104%, 0);
  will-change: transform;
  background-color: #7488a0;
  background-image:
    /* 両わきのレールの影 */
    linear-gradient(90deg, rgba(12, 16, 26, .6) 0, rgba(12, 16, 26, .18) 14px, rgba(12, 16, 26, 0) 26px, rgba(12, 16, 26, 0) calc(100% - 26px), rgba(12, 16, 26, .18) calc(100% - 14px), rgba(12, 16, 26, .6) 100%),
    /* 下のほうの使いこんだ汚れ */
    linear-gradient(0deg, rgba(58, 44, 28, .32) 0, rgba(58, 44, 28, 0) 22%),
    /* 全体の明暗（上が明るい） */
    linear-gradient(180deg, rgba(255, 255, 255, .12) 0, rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .14) 100%),
    /* 細い傷 */
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 0 37px, rgba(255, 255, 255, .06) 37px 38px, rgba(255, 255, 255, 0) 38px 91px, rgba(0, 0, 0, .07) 91px 92px),
    /* 波板の1枚（山・谷・つなぎ目） */
    linear-gradient(180deg, #b9c8d9 0, #97aac0 9%, #8699b0 46%, #7488a0 55%, #5b6c82 60%, #4b5a6e 86%, #1d2430 86%, #1d2430 94%, #a3b4c8 94%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% var(--slat);
  background-repeat: no-repeat, no-repeat, no-repeat, repeat, repeat-y;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 calc(100% - var(--bar));
}
.tr-sh-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bar);
  border-top: 4px solid #192038;
  border-bottom: 4px solid #192038;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .28) 0, rgba(255, 255, 255, 0) 35%, rgba(0, 0, 0, .22) 100%),
    repeating-linear-gradient(-45deg, #ffc53d 0 18px, #1e222b 18px 36px);
}
.tr-sh-grip {
  position: absolute;
  bottom: calc(var(--bar) + 8px);
  width: clamp(46px, 12vw, 76px);
  height: 13px;
  border: 2.5px solid #192038;
  border-radius: 7px;
  background: linear-gradient(180deg, #55607a 0, #2a313d 60%, #1b1f27 100%);
  box-shadow: 0 3px 0 rgba(12, 16, 26, .45);
}
/* 落ちてくるとき：下の画面に落ちる影 */
.tr-sh-shade {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 46px;
  background: linear-gradient(180deg, rgba(10, 14, 24, .5), rgba(10, 14, 24, 0));
  opacity: 1;
}
/* 上がるとき：すき間からの工房の灯り（garage-art.js のすき間の光 #ffe2b0） */
.tr-sh-glow {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 26vh;
  background: linear-gradient(180deg, rgba(255, 226, 168, .62) 0, rgba(255, 226, 168, .22) 40%, rgba(255, 226, 168, 0) 100%);
  opacity: 0;
}
.tr-sh-emblem {
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(44vmin, 230px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 5px 0 rgba(12, 16, 26, .45));
}
.tr-sh-emblem svg { display: block; width: 100%; height: 100%; }
.tr-em-glow { opacity: .25; }
/* 巻き取りの箱（上） */
.tr-sh-head {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(var(--slat) * 1.4 + env(safe-area-inset-top, 0px));
  transform: translate3d(0, calc(-100% - 150px), 0);
  will-change: transform;
  border-bottom: 4px solid #192038;
  background:
    radial-gradient(circle at 50% 50%, #c9d1dd 0 2.2px, #192038 2.8px 4px, transparent 4.6px) 22px 50% / 64px 16px repeat-x,
    linear-gradient(180deg, #55607a 0, #3a4352 70%, #2a313d 100%);
  box-shadow: 0 6px 0 rgba(12, 16, 26, .35);
}
/* 巻き取りの箱から下がるネオン看板（garage-art.js の paintNeon と同じ「はつめい GARAGE」・色） */
.tr-sh-neon {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  width: clamp(168px, 24vw, 250px);
  aspect-ratio: 4 / 1.25;
  transform: translateX(-50%);
  border: 3px solid #192038;
  border-radius: 12px;
  background: repeating-linear-gradient(180deg, #0f1424 0 11px, #141a2c 11px 12px);
  box-shadow: 0 5px 0 rgba(12, 16, 26, .4);
}
.tr-sh-neon::before,
.tr-sh-neon::after {
  content: "";
  position: absolute;
  bottom: 100%;
  width: 3px;
  height: 12px;
  background: #8a94a6;
}
.tr-sh-neon::before { left: 18%; }
.tr-sh-neon::after { right: 18%; }
.tr-sh-neon > i {
  position: absolute;
  inset: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid #4a3a52;
  border-radius: 9px;
  font-style: normal;
  line-height: 1;
}
.tr-sh-neon b {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 800;
  font-size: clamp(17px, 2.4vw, 24px);
  letter-spacing: .08em;
  color: #34404f;
}
.tr-sh-neon span {
  margin-top: 3px;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 800;
  font-size: clamp(10px, 1.1vw, 12px);
  letter-spacing: .5em;
  text-indent: .5em;
  color: #3e3a2a;
}
.tr-neon-on {
  opacity: 0;
  border-color: #ff7cc8 !important;
  box-shadow: 0 0 10px rgba(255, 79, 180, .75), inset 0 0 8px rgba(255, 79, 180, .45);
}
.tr-neon-on b { color: #fff; text-shadow: 0 0 2px #bffbff, 0 0 8px #34f0ff, 0 0 16px #34f0ff; }
.tr-neon-on span { color: #fff3b0; text-shadow: 0 0 6px #ffd23f, 0 0 12px #ffb703; }

.tr-sh-dust {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
}
.tr-sh-dust i {
  position: absolute;
  bottom: -18px;
  width: 84px;
  height: 46px;
  margin-left: -42px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(226, 219, 204, .85), rgba(226, 219, 204, 0));
  opacity: 0;
}
.tr-sh-dust i:nth-child(1) { left: 6%; }
.tr-sh-dust i:nth-child(2) { left: 16%; }
.tr-sh-dust i:nth-child(3) { left: 28%; }
.tr-sh-dust i:nth-child(4) { left: 40%; }
.tr-sh-dust i:nth-child(5) { left: 60%; }
.tr-sh-dust i:nth-child(6) { left: 72%; }
.tr-sh-dust i:nth-child(7) { left: 84%; }
.tr-sh-dust i:nth-child(8) { left: 94%; }

/* ---------- 青焼きの設計図（メニューの .mn-bp と同じ地） ---------- */
.tr-bp-sheet {
  position: absolute;
  inset: 0;
  transform: translate3d(106%, 0, 0);
  will-change: transform;
  background-color: #12306e;
  background-image:
    linear-gradient(rgba(255, 255, 255, .11) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, .11) 2px, transparent 2px),
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px),
    radial-gradient(120% 90% at 50% 0%, #2153b8 0%, #14367a 55%, #0b1f4c 100%);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px, 100% 100%;
  background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px, 0 0;
  box-shadow: 0 0 0 4px #192038, 0 0 46px 6px rgba(8, 14, 32, .45);
}
/* 紙のふち（左右どちらにも定規の目盛り。画面の外にあり、すべっている間だけ見える） */
.tr-bp-sheet::before,
.tr-bp-sheet::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 26px;
  background:
    repeating-linear-gradient(180deg, #12306e 0 2px, transparent 2px 60px) 0 0 / 14px 100% no-repeat,
    repeating-linear-gradient(180deg, #12306e 0 1.5px, transparent 1.5px 12px) 0 0 / 8px 100% no-repeat,
    #eef3fb;
  border-left: 3px solid #192038;
  border-right: 3px solid #192038;
}
.tr-bp-sheet::before { right: 100%; transform: scaleX(-1); }
.tr-bp-sheet::after { left: 100%; }
.tr-bp-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.tr-bp-art {
  width: min(92vw, 600px, 76vh);
  height: auto;
  overflow: visible;
}
.tr-bp-ln {
  fill: none;
  stroke: rgba(236, 244, 255, .9);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.tr-bp-ln.is-thin { stroke-width: 1.4; stroke: rgba(236, 244, 255, .5); stroke-dasharray: 1; }
.tr-bp-ln.is-acc { stroke: #ffd426; }
.tr-bp-block {
  position: absolute;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 1px;
  min-width: 150px;
  padding: 8px 14px 9px;
  border: 2px solid rgba(236, 244, 255, .8);
  color: rgba(236, 244, 255, .92);
  font-family: 'M PLUS Rounded 1c', sans-serif;
  letter-spacing: .06em;
  text-align: left;
}
.tr-bp-block b { font-size: 16px; font-weight: 800; }
.tr-bp-block span { font-size: 14px; font-weight: 700; opacity: .8; }

/* ---------- VS（準備→バトル）：赤と青が斜めにぶつかる ---------- */
.tr-vs-a,
.tr-vs-b {
  position: absolute;
  inset: -2px;
  will-change: transform;
}
.tr-vs-a {
  clip-path: polygon(0 0, calc(50% + 18vh + 2px) 0, calc(50% - 18vh + 2px) 100%, 0 100%);
  transform: translate3d(-102%, 0, 0);
  background:
    repeating-linear-gradient(110deg, rgba(255, 255, 255, 0) 0 46px, rgba(255, 255, 255, .13) 46px 54px, rgba(255, 255, 255, 0) 54px 120px),
    radial-gradient(70% 90% at 20% 30%, rgba(255, 210, 120, .45), rgba(255, 210, 120, 0) 70%),
    linear-gradient(125deg, #b8232a 0%, #e8392f 48%, #ff7a2f 100%);
}
.tr-vs-b {
  clip-path: polygon(calc(50% + 18vh - 2px) 0, 100% 0, 100% 100%, calc(50% - 18vh - 2px) 100%);
  transform: translate3d(102%, 0, 0);
  background:
    repeating-linear-gradient(110deg, rgba(255, 255, 255, 0) 0 46px, rgba(255, 255, 255, .13) 46px 54px, rgba(255, 255, 255, 0) 54px 120px),
    radial-gradient(70% 90% at 80% 70%, rgba(150, 240, 255, .45), rgba(150, 240, 255, 0) 70%),
    linear-gradient(125deg, #1e9bd7 0%, #1c6fd6 52%, #1a3fa8 100%);
}
.tr-vs-seam {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}
.tr-vs-seam line { stroke: #fff; stroke-width: 9; stroke-linecap: square; }
.tr-vs-seam line.is-ink { stroke: #192038; stroke-width: 17; }
.tr-vs-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 50% at 50% 50%, #fff 0, rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, 0) 100%);
  opacity: 0;
}
.tr-vs-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(62vmin, 340px);
  aspect-ratio: 320 / 190;
  transform: translate(-50%, -50%);
  opacity: 0;
}
.tr-vs-svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 6px 0 rgba(12, 16, 26, .35));
}
.tr-vs-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 190%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 246, 196, .5) 0 5deg, rgba(255, 246, 196, 0) 5deg 15deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, .7) 45%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, .7) 45%, transparent 100%);
  opacity: 0;
}

/* ---------- 「動きを減らす」：短いフェード ---------- */
.tr-fade { background: #192038; opacity: 0; }

/* ---------- バトル→結果：パッと白く光る（覆わない・押せるまま） ---------- */
#tr-flash {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 45%, #fff 0, #fff 42%, #fff7e0 100%);
}
#tr-flash.is-champ { background: radial-gradient(circle at 50% 45%, #fff 0, #fffbe8 38%, #ffe38a 100%); }
