/* はつめいロボバトルDX — ui.css：P4 の画面（入口・タイトル・カップ・つぎの相手・フリーバトル・れんしゅう・バトルの HUD と操作・ふたりで・結果・しゃしん・重ねる画面）
   2026-12-02 P4 が新しく作った。base.css・battle.css・screens.css の後に読み、上書きする。持ち主：P4
   決めごと：押せる所は 44px 以上・主操作は 56px 以上、本文 14px 以上・ボタンの字 15px 以上。左だけ太い色線は使わない。押下に合わせて光らせない */

/* メニューの見出し（ブリキ看板の札）に、題字ロゴと同じ書体 Dela Gothic One（OFL 1.1・common/fonts/）を使う（2026-12-02） */
@import url('../../common/fonts/dela-gothic-one.css');

/* ---------- 共通 ---------- */
.kl-logo { display: block; width: 100%; height: auto; }

/* メニューの共通（2026-12-02 本人のテストプレイの指摘で作り直し。大会・発明・ガレージの世界観）
   .mn-plate：ブリキ看板の見出し札（黄色の板・左右の鋲・少し傾ける）
   .mn-bp：青焼きの方眼（設計図）の地。.mn-box：同じ地の箱 */
.mn-plate {
  position: relative;
  display: inline-block;
  margin: 0;
  padding: 5px 22px 7px;
  font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
  font-weight: 400;
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: .05em;
  color: var(--ink);
  background: linear-gradient(180deg, #fff1a1 0%, #ffd426 42%, #f2b400 58%, #ffcf26 100%);
  border: 3px solid var(--ink);
  border-radius: 9px;
  box-shadow: 0 4px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(150, 90, 0, .35);
  transform: rotate(-2deg);
  white-space: nowrap;
}
.mn-plate::before,
.mn-plate::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 1px, #c9cdd6 1.5px, #7a8194 100%);
  box-shadow: 0 0 0 1.5px var(--ink);
}
.mn-plate::before { left: 7px; }
.mn-plate::after { right: 7px; }
.mn-bp,
.scr-page.mn-bp {
  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;
}
.mn-box,
.scr-sheet-box.mn-box,
.vs-bottom.mn-box {
  background-color: #14367a;
  background-image:
    linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(180deg, #1d4aa6 0%, #122f6c 100%);
  background-size: 20px 20px, 20px 20px, 100% 100%;
  box-shadow: 0 6px 0 var(--ink), inset 0 0 0 2px #3f69c6;
}
.mn-bp .scr-title,
.mn-box .scr-title { color: var(--ink); }
/* ★の数のかわりの目盛り（icons.js の meter）。右へ行くほど高い3本 */
.mtr { display: inline-flex; align-items: flex-end; gap: 2px; vertical-align: middle; }
.mtr i { display: block; width: 7px; height: 12px; border-radius: 2px; border: 1.5px solid var(--ink); background: #fff; }
.mtr i:nth-child(2) { height: 15px; }
.mtr i:nth-child(3) { height: 18px; }
.mtr i.on { background: #ff6b2b; }

.scr-back {
  font-family: inherit;
  font-weight: 900;
  font-size: 15px;
  min-height: 44px;
  min-width: 92px;
  padding: 0 16px 0 10px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
}
.scr-back span { font-size: 24px; line-height: 1; margin-top: -2px; }
.scr-back:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.scr-head { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.scr-title { margin: 0; font-size: 22px; font-weight: 900; color: var(--ink); }

@keyframes p4SheetUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes p4Fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes p4Pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }

/* ガレージのパーツの格子の「NEW」：札（workshop.css の .g-new）はカードの角から上と右へはみ出す形。
   格子が縦に送る箱（overflow）なので、1段目の札の上と右端の列の札の右が切れていた（2026-12-02 本人の指摘「NEWのピルの上が欠けている」）。
   はみ出す分だけ格子の内側に余白をとる（workshop.css は触らず、後に読む ui.css で足す） */
.g-parts-grid { padding-top: 10px; padding-right: 7px; }

/* ---------- 入口（読み込み・3.1節） ---------- */
html.is-loading, html.is-loading body { overflow: hidden; }
/* 2026-12-02 作り直し：発明家の工房。地は青焼きの方眼（メニューの .mn-bp と同じ色）。
   動きは js/loading.js が付けるクラスと変数で決まる：
   --draw（設計図の線 0〜1）・--ldraw（題字の線 0〜1）・--p（進み具合）
   .lr-part：なし＝画面の外（クレーンで横から運ぶ）／.next＝吊られて待つ／.in＝はまった
   .bp-slot：.next＝次にはまる場所（線が流れる）／.filled＝はまった
   .ld-stage：.motor＝全部はまって試運転（タイヤが回る）／.boot＝起動。#scr-loading.booted＝題字が刷られる
   変形の原点は SVG の座標で HTML に書いてある（transform-box は既定の view-box） */
#scr-loading {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow: hidden;
  color: #fff;
  background-color: #12306e;
  background-image:
    radial-gradient(56% 42% at 50% 38%, rgba(120, 180, 255, .24) 0%, rgba(120, 180, 255, 0) 100%),
    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: 100% 100%, 120px 120px, 120px 120px, 24px 24px, 24px 24px, 100% 100%;
  background-position: 0 0, -2px -2px, -2px -2px, -1px -1px, -1px -1px, 0 0;
  transition: opacity .25s ease, visibility .25s ease;
  touch-action: manipulation;
}
#scr-loading.out { opacity: 0; visibility: hidden; pointer-events: none; }
.ld-box { display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(100%, 400px); text-align: center; }
.ld-kids { width: min(50vw, 188px); padding: 7px 14px; background: var(--ink); border-radius: 999px; transform: rotate(-2deg); box-shadow: 0 4px 0 rgba(0, 0, 0, .3), 0 0 0 2px rgba(255, 255, 255, .16); }
.ld-stage { width: min(100%, 380px); }
.ld-robo { display: block; width: 100%; height: auto; overflow: hidden; }

/* 設計図の線：破線の長さ（--len）は loading.js が測る。--draw に合わせて線が伸びる */
.bp-draw {
  fill: none;
  stroke: #cfe3ff;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: calc(var(--len, 0) * 1px) calc(var(--len, 0) * 1px);
  stroke-dashoffset: calc(var(--len, 0) * (1 - var(--draw, 0)) * 1px);
  transition: stroke-dashoffset .3s linear, stroke .2s ease;
}
.bp-crop { stroke: #8fb6f5; }
.bp-dim { stroke: #8fb6f5; stroke-width: 1.2; }
.bp-center { fill: none; stroke: #7ea6ee; stroke-width: 1; stroke-dasharray: 12 3 2 3; opacity: calc(var(--draw, 0) * .7); transition: opacity .3s linear; }
.bp-num { font-family: 'M PLUS Rounded 1c', sans-serif; font-weight: 800; font-size: 10px; letter-spacing: .08em; fill: #a9ccff; text-anchor: middle; dominant-baseline: central; opacity: calc((var(--draw, 0) - .8) * 5); transition: opacity .3s ease; }
.bp-slot { transition: opacity .3s ease .24s; }
.bp-slot.filled { opacity: 0; }
.bp-slot.next .bp-draw { stroke: #ffd426; stroke-width: 2; stroke-dasharray: 5px 4px; animation: bpAnts .6s linear infinite; }
.bp { transition: opacity .5s ease; }
.ld-stage.boot .bp { opacity: .5; }
@keyframes bpAnts { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -9px; } }

/* 天井クレーンのレール（部品を吊って運ぶ） */
.lr-railbox { opacity: calc(var(--draw, 0) * 1.4 - .2); transition: opacity .3s ease; }
.lr-rail { fill: #6f86b6; stroke: #0b1f4c; stroke-width: 2; }
.lr-rivet { fill: none; stroke: #c7d5f0; stroke-width: 3.4; stroke-linecap: round; }
.ld-stage.boot .lr-railbox { opacity: .45; }

/* ロボ */
.lr-shadow { fill: rgba(5, 14, 40, .5); opacity: 0; transform-origin: 160px 216px; transition: opacity .3s ease; }
.ld-stage:not([data-n="0"]) .lr-shadow { opacity: 1; }
.lr-tire { fill: #2b3036; stroke: var(--ink); stroke-width: 4; }
.lr-tread { fill: none; stroke: #636b74; stroke-width: 3.5; stroke-dasharray: 4.2 3.5; }
.lr-rim { fill: #868e96; stroke: var(--ink); stroke-width: 2.5; }
.lr-hole { fill: #343a40; }
.lr-hub { fill: #e9ecef; stroke: var(--ink); stroke-width: 2.5; }
.lr-slot { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
.lr-core { fill: #228be6; stroke: var(--ink); stroke-width: 4; }
.lr-core-hl { fill: #fff; opacity: .32; }
.lr-chipslot { fill: #0b1f4c; stroke: var(--ink); stroke-width: 2.5; }
.lr-visor { fill: #192038; }
.lr-eye { fill: #2c3d63; transition: fill .15s ease; }
.lr-eyes-glow { fill: #66f7ff; opacity: 0; transition: opacity .3s ease .1s; }
.lr-scan { opacity: 0; }
.lr-vent { fill: #1971c2; stroke: var(--ink); stroke-width: 2.5; }
.lr-vent-l { fill: none; stroke: #0b3d75; stroke-width: 2.5; stroke-linecap: round; }
.lr-ant { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.lr-ant-tip { fill: #e8590c; stroke: var(--ink); stroke-width: 3; transition: fill .2s ease; }
.lr-arm { fill: #74c0fc; stroke: var(--ink); stroke-width: 4; }
.lr-shield { fill: #ffd426; stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.lr-shield-in { fill: #f59f00; opacity: .45; }
.lr-drill { fill: #dee2e6; stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.lr-drill-line { fill: none; stroke: #495057; stroke-width: 2.5; stroke-linecap: round; }
.lr-collar { fill: #868e96; stroke: var(--ink); stroke-width: 4; }
.lr-chip { fill: #ffd426; stroke: var(--ink); stroke-width: 3; }
.lr-chip-lbl { fill: #192038; }
.lr-led { fill: #2f5b3e; stroke: var(--ink); stroke-width: 1.5; transition: fill .2s ease; }
.lr-cable { fill: none; stroke: #dfe9ff; stroke-width: 2; }
.lr-trolley { fill: #adb5bd; stroke: #0b1f4c; stroke-width: 2; }
.lr-hook { fill: #adb5bd; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.lr-sig { fill: none; stroke: #ffe066; stroke-width: 3; stroke-linecap: round; opacity: 0; transform-origin: 136px 74px; }

/* 部品の動き：横からクレーンで運ぶ → 吊られて待つ → 放されてはまる。速い端末で「待つ」を飛ばしても、外から飛んできてはまる */
.lr-part { transform: translate(calc(var(--wx, 0px) + var(--ox, -420px)), var(--wy, 0px)); transition: transform .7s cubic-bezier(.22, .8, .3, 1); }
.lr-part.next { transform: translate(var(--wx, 0px), var(--wy, 0px)); }
.lr-part.in { transform: none; transition: transform .42s cubic-bezier(.3, 1.4, .55, 1); }
.lr-crane { opacity: 0; transition: opacity .1s ease; }
.lr-part.next .lr-crane { opacity: 1; transition: none; }
.lr-part.next .lr-swing { animation: lrSwing 2.8s linear .35s infinite; }
.lr-part:not(.in) .lr-bolt { opacity: 0; }
.lr-part.in .lr-bolt { animation: lrBolt .36s cubic-bezier(.3, 1.5, .5, 1) .28s both; }
.lr-all.thud { animation: lrThud .24s ease-out; transform-origin: 160px 214px; }
.ld-stage.motor .lr-rotor { animation: lrSpin 1.1s linear infinite; }
@keyframes lrSwing {
  0% { transform: rotate(0); animation-timing-function: cubic-bezier(.33, .66, .66, 1); }
  25% { transform: rotate(2deg); animation-timing-function: cubic-bezier(.33, 0, .66, .33); }
  50% { transform: rotate(0); animation-timing-function: cubic-bezier(.33, .66, .66, 1); }
  75% { transform: rotate(-2deg); animation-timing-function: cubic-bezier(.33, 0, .66, .33); }
  100% { transform: rotate(0); }
}
@keyframes lrBolt { from { transform: rotate(-160deg) scale(1.6); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes lrThud { 0% { transform: none; } 35% { transform: translateY(2px) scale(1.012, .984); } 100% { transform: none; } }
@keyframes lrSpin { to { transform: rotate(360deg); } }

/* 起動：目がちらついて点く・バイザーを光が走る・アンテナから信号・ロボが跳ねる。そのあとは時々まばたき */
.ld-stage.boot .lr-eye { fill: #66f7ff; animation: lrEyeOn .5s steps(1, end) both; }
.ld-stage.boot .lr-eyes-glow { opacity: .8; }
.ld-stage.boot .lr-eyes { animation: lrBlink 4.6s ease-in-out 1.6s infinite; }
.ld-stage.boot .lr-scan { opacity: 1; animation: lrScan .62s cubic-bezier(.5, 0, .3, 1) .08s both; }
.ld-stage.boot .lr-ant-tip { fill: #ffe066; }
.ld-stage.boot .lr-led { fill: #69db7c; }
.ld-stage.boot .lr-sig { animation: lrSig .9s ease-out .22s both; }
.ld-stage.boot .lr-rig { transform-origin: 160px 214px; animation: lrHop .56s cubic-bezier(.3, 0, .3, 1) .14s both, lrIdle 2.4s ease-in-out 1s infinite alternate; }
.ld-stage.boot .lr-shadow { animation: lrShadow .56s cubic-bezier(.3, 0, .3, 1) .14s both; }
@keyframes lrEyeOn { 0% { opacity: .25; } 18% { opacity: 1; } 30% { opacity: .3; } 46% { opacity: 1; } 100% { opacity: 1; } }
@keyframes lrBlink { 0%, 90%, 100% { transform: none; } 94% { transform: scaleY(.12); } }
@keyframes lrScan { from { transform: translateX(0); } to { transform: translateX(132px); } }
@keyframes lrSig { 0% { opacity: 0; transform: scale(.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes lrHop { 0% { transform: none; } 38% { transform: translateY(-14px); } 62% { transform: translateY(0) scale(1.04, .95); } 80% { transform: scale(.99, 1.01); } 100% { transform: none; } }
@keyframes lrIdle { from { transform: none; } to { transform: translateY(-2px); } }
@keyframes lrShadow { 0%, 100% { transform: none; } 38% { transform: scale(.82); opacity: .6; } }
/* 題字：読み込み中は字の輪郭を線で引き（--ldraw）、起動で左から色が刷られる。印刷の光の線が刷る位置を示す */
.ld-title { position: relative; width: min(88%, 340px); aspect-ratio: 1221 / 419; margin-top: -4px; }
.ld-draft, .ld-ink { position: absolute; inset: 0; line-height: 0; }
.ld-draft svg, .ld-ink svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ld-dl {
  fill: none;
  stroke: #cfe3ff;
  stroke-width: 5;
  stroke-linejoin: round;
  stroke-dasharray: calc(var(--len, 0) * 1px) calc(var(--len, 0) * 1px);
  /* 字ごとの受け持ち（--a から幅 --w）の間だけ線が伸びる。--a・--w が無いときは全体でいっしょに伸びる */
  stroke-dashoffset: calc(var(--len, 0) * (1 - clamp(0, (var(--ldraw, 0) - var(--a, 0)) / var(--w, 1), 1)) * 1px);
  transition: stroke-dashoffset .4s linear;
}
.ld-draft { opacity: .9; transition: opacity .3s ease .45s; }
.ld-ink { -webkit-clip-path: inset(-10% 100% -10% 0); clip-path: inset(-10% 100% -10% 0); }
#scr-loading.booted .ld-ink { -webkit-clip-path: inset(-10% -10% -10% 0); clip-path: inset(-10% -10% -10% 0); transition: clip-path .6s cubic-bezier(.6, 0, .25, 1), -webkit-clip-path .6s cubic-bezier(.6, 0, .25, 1); }
#scr-loading.booted .ld-draft { opacity: 0; }
.ld-title::after {
  content: "";
  position: absolute;
  top: -8%;
  bottom: -8%;
  left: 0;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: #f1fdff;
  box-shadow: 0 0 10px 3px rgba(102, 247, 255, .75);
  opacity: 0;
  pointer-events: none;
}
#scr-loading.booted .ld-title.has-logo::after { animation: ldHead .6s cubic-bezier(.6, 0, .25, 1) both; }
#scr-loading.booted .ld-title { animation: ldStamp .32s ease-out .52s both; }
@keyframes ldHead { 0% { left: 0; opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes ldStamp { 0% { transform: scale(1.035); } 100% { transform: none; } }
/* logo.js が読めないときの題字 */
.ld-name {
  display: none;
  position: absolute;
  inset: 0;
  margin: 0;
  align-items: center;
  justify-content: center;
  font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
  font-weight: 400;
  font-size: clamp(22px, 6.4vw, 30px);
  color: #ffd426;
  letter-spacing: .02em;
  text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 6px 0 rgba(0, 0, 0, .3);
}
#scr-loading.booted .ld-title.no-logo .ld-name { display: flex; animation: p4Pop .4s ease-out both; }

/* 下の段：読み込み中は縮尺の目盛り（進み具合）とひとこと、起動が終わったらボタン。高さをとっておき、入れ替わっても上が動かない */
.ld-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; min-height: 142px; padding-top: 6px; }
.ld-bar {
  position: relative;
  width: min(64vw, 240px);
  height: 12px;
  margin-top: 8px;
  border: 2px solid #cfe3ff;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(207, 227, 255, .45) calc(10% - 1px) 10%);
}
.ld-bar i { display: block; height: 100%; background: linear-gradient(180deg, #ffe066, #fab005); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .3s ease; }
/* 目盛りの上の三角：いまの位置を指す */
.ld-bar::after {
  content: "";
  position: absolute;
  top: -10px;
  left: calc(var(--p, 0) * 100%);
  margin-left: -5px;
  border: 5px solid transparent;
  border-top: 6px solid #ffd426;
  border-bottom: 0;
  transition: left .3s ease;
}
.ld-msg { margin: 0; font-size: 15px; font-weight: 800; color: #e3eeff; min-height: 1.5em; letter-spacing: .02em; }
#scr-loading.gate .ld-bar, #scr-loading.gate .ld-msg { display: none; }
.ld-gate { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: min(100%, 300px); animation: p4SheetUp .28s ease-out both; }
.ld-btn {
  position: relative;
  font-family: inherit;
  font-weight: 900;
  font-size: 17px;
  min-height: 52px;
  padding: 8px 18px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #eef2f8 55%, #dde4ef 100%);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--ink), inset 0 2px 0 #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  touch-action: manipulation;
}
/* 主ボタン：メニューの見出しと同じブリキ看板（黄色の板・左右の鋲） */
.ld-btn--main {
  font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
  font-weight: 400;
  font-size: 26px;
  letter-spacing: .06em;
  min-height: 70px;
  background: linear-gradient(180deg, #fff1a1 0%, #ffd426 42%, #f2b400 58%, #ffcf26 100%);
  box-shadow: 0 5px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(150, 90, 0, .35);
}
.ld-btn--main::before,
.ld-btn--main::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 1px, #c9cdd6 1.5px, #7a8194 100%);
  box-shadow: 0 0 0 1.5px var(--ink);
}
.ld-btn--main::before { left: 10px; }
.ld-btn--main::after { right: 10px; }
.ld-btn small { font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 14px; font-weight: 800; letter-spacing: 0; }
.ld-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.ld-err { margin: 6px 0 0; display: grid; justify-items: center; gap: 10px; font-size: 15px; font-weight: 800; color: #fff; }

/* 入口の大きさ：低い画面は詰め、大きい画面は少し大きく */
@media (max-height: 700px) {
  .ld-box { gap: 4px; }
  .ld-kids { width: min(42vw, 150px); padding: 5px 12px; }
  .ld-stage { width: min(88%, 300px); }
  .ld-title { width: min(78%, 280px); }
  .ld-foot { min-height: 128px; gap: 6px; }
  .ld-gate { gap: 10px; }
  .ld-btn--main { min-height: 62px; font-size: 24px; }
  .ld-btn { min-height: 50px; }
}
@media (min-width: 900px) and (min-height: 900px) {
  .ld-box { width: min(100%, 480px); }
  .ld-stage { width: 460px; }
  .ld-title { width: 400px; }
}
@media (prefers-reduced-motion: reduce) {
  .bp-draw, .ld-dl { stroke-dasharray: none; transition: none; }
  .bp-center, .bp-num, .lr-railbox { transition: none; }
  .bp-slot.next .bp-draw { animation: none; stroke-dasharray: none; }
  .lr-part, .lr-part.in { transition: none; }
  .lr-part:not(.in) { visibility: hidden; }
  .lr-part.next .lr-swing, .lr-part.in .lr-bolt, .lr-all.thud, .ld-stage.motor .lr-rotor { animation: none; }
  .ld-stage.boot .lr-eye, .ld-stage.boot .lr-eyes, .ld-stage.boot .lr-scan, .ld-stage.boot .lr-sig,
  .ld-stage.boot .lr-rig, .ld-stage.boot .lr-shadow { animation: none; }
  .ld-stage.boot .lr-scan { opacity: 0; }
  #scr-loading.booted .ld-ink { transition: none; }
  #scr-loading.booted .ld-title, #scr-loading.booted .ld-title.has-logo::after, #scr-loading.booted .ld-title.no-logo .ld-name { animation: none; }
  .ld-bar i, .ld-bar::after { transition: none; }
}

/* ---------- タイトル（3.2節） ---------- */
#title-screen { padding: max(12px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom)); }
html.is-loading #title-screen { visibility: hidden; }
#title-screen .title-top { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 8px; }
.t-kids {
  pointer-events: auto;
  display: flex;
  align-items: center;
  width: min(36vw, 150px);
  min-height: 44px;
  padding: 6px 12px;
  background: var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .25);
  touch-action: manipulation;
}
.t-icons { display: flex; gap: 6px; pointer-events: auto; }
.t-icon {
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 52px;
  min-height: 54px;
  padding: 4px 6px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 900;
  font-size: 14px;
  line-height: 1.1;
  cursor: pointer;
  touch-action: manipulation;
}
.t-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.t-icon:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
#title-screen .title-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; padding-top: 3vh; pointer-events: none; }
#title-screen .title-logo { width: min(90vw, 560px); margin: 0; font-size: clamp(30px, 9vw, 52px); text-align: center; color: #fff; }
.title-logo-text {
  display: block;
  font-weight: 900;
  letter-spacing: .01em;
  text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 7px 0 rgba(0, 0, 0, .25);
}
.title-career {
  margin: 0;
  padding: 4px 14px;
  background: rgba(255, 255, 255, .94);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
}
#title-screen .title-bottom { width: min(100%, 420px); gap: 10px; }
.title-main {
  font-family: inherit;
  width: 100%;
  min-height: 74px;
  border-radius: 22px;
  border: 3px solid var(--ink);
  background: #ffd426;
  color: var(--ink);
  font-weight: 900;
  font-size: 27px;
  letter-spacing: .04em;
  line-height: 1.15;
  box-shadow: 0 5px 0 var(--ink), 0 10px 22px rgba(15, 23, 42, .25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  touch-action: manipulation;
}
.title-main small { font-size: 14px; font-weight: 800; letter-spacing: 0; }
.title-main:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.title-sub-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.title-second {
  font-family: inherit;
  min-height: 58px;
  border-radius: 18px;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
.title-second:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.title-text-btn {
  font-family: inherit;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  cursor: pointer;
  touch-action: manipulation;
}
/* ほかの KIDS と同じ並び（© ・あそびかた・おうちの方へ・ライセンス・AMIX GAMES KIDS）。スマホでは2段に折れてよい（2026-12-02） */
/* 行の間は詰め、「 / 」で区切る（2026-12-02 本人） */
/* 親（.title-bottom・最大420px）より広く取り、PC では1行に収める。スマホは © の行とリンクの行に分ける（区切りが行頭に来ないように） */
#title-screen .title-footer-links { gap: 0; flex-wrap: wrap; line-height: 1.5; padding: 0 12px; width: 100vw; max-width: 760px; align-self: center; box-sizing: border-box; }
#title-screen .title-footer-links > span { display: inline-flex; align-items: center; font-size: 13px; font-weight: 800; white-space: nowrap; }
#title-screen .title-footer-links > span + span::before { content: '/'; margin: 0 8px; opacity: .7; }
/* フリーバトルのシートを開いている間は、シートの左右にフッターの字がはみ出して見えないように隠す */
body:has(#scr-free:not([hidden])) #title-screen .title-footer-links { visibility: hidden; }
@media (max-width: 600px) {
  #title-screen .title-footer-links > span:first-child { flex-basis: 100%; justify-content: center; }
  #title-screen .title-footer-links > span:nth-child(2)::before { content: none; }
  #title-screen .title-footer-links > span + span::before { margin: 0 6px; }
  #title-screen .title-footer-links > span, #title-screen .title-footer-links a { font-size: 12px; }
}
@media (max-width: 420px) {
  #title-screen .title-footer-links > span:nth-child(4) { flex-basis: 100%; justify-content: center; }
  #title-screen .title-footer-links > span:nth-child(4)::before { content: none; }
}
#title-screen .title-footer-links a { display: inline; padding: 2px 0; font-size: 13px; font-weight: 800; }

/* ---------- 重ねる画面の枠（カップ・れんしゅう） ---------- */
.scr-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--tb);
  z-index: 42;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #e7f5ff 0%, #d0ebff 100%);
  overflow-y: auto;
  animation: p4Fade .2s ease-out;
}
.scr-body { width: min(100%, 680px); margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

/* カップ（2026-12-02 作り直し：本人の指摘「どこを押すのか・どれが選ばれているのか・階級が何か・○○○○の意味が伝わらない」）
   地は青焼きの方眼（.mn-bp）。カードは トロフィー／カップ名／ロボの決まり（階級）／1回戦〜決勝の道のり／押すと始まる帯。
   スマホは横長のカードを縦に、PC（1040px〜）は4枚の掲示（ポスター）を横に並べる */
#scr-cup .scr-head,
#scr-cup .scr-body { position: relative; z-index: 1; }
#scr-cup .scr-head { gap: 14px; }
#scr-cup::before {
  content: "";
  position: fixed;
  right: 0;
  bottom: var(--tb);
  width: min(78vw, 680px);
  height: min(62vh, 480px);
  background: radial-gradient(circle, rgba(255, 212, 38, .3) 1.7px, transparent 2.2px) 0 0 / 13px 13px;
  -webkit-mask-image: radial-gradient(circle at 100% 100%, #000 0%, rgba(0, 0, 0, .55) 32%, transparent 70%);
  mask-image: radial-gradient(circle at 100% 100%, #000 0%, rgba(0, 0, 0, .55) 32%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.cup-wrap { width: min(100%, 1180px); gap: 12px; padding-bottom: 6px; }
.cup-lead { margin: 2px 0 0; color: #fff; font-size: 15px; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.cup-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
.cup-card {
  --cup-bg: #ffe0bd;
  position: relative;
  font-family: inherit;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  grid-template-areas: "art body" "cta cta";
  column-gap: 12px;
  row-gap: 10px;
  align-items: center;
  padding: 12px;
  text-align: left;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #fffdf6;
  color: var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
}
.cup-card[data-idx="1"] { --cup-bg: #dbe4ee; }
.cup-card[data-idx="2"] { --cup-bg: #fff0b3; }
.cup-card[data-idx="3"] { --cup-bg: #f0d4fa; }
.cup-card:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
/* いま進めるカップ：内側の黄色の縁＋角の帯「つぎは ここ」＋帯がオレンジ。外へ outline を出さない（送る枠で切れる） */
.cup-card.is-next { background: #fffbe6; box-shadow: 0 5px 0 var(--ink), inset 0 0 0 3px #ffd426; }
.cup-card.is-next .cup-top { padding-right: 58px; }
.cup-next-tag {
  position: absolute;
  top: 22px;
  right: -38px;
  width: 172px;
  padding: 3px 0;
  transform: rotate(45deg);
  background: #e03131;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}
.cup-art-wrap {
  grid-area: art;
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: radial-gradient(circle, rgba(25, 32, 56, .13) 1.4px, transparent 1.9px) 0 0 / 8px 8px, var(--cup-bg);
  display: grid;
  place-items: center;
}
.cup-art { display: block; width: 58px; height: 58px; }
.cup-no {
  position: absolute;
  left: -3px;
  top: -3px;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 12px 0 10px 0;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
}
.cup-lock {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: #ffd426;
  color: var(--ink);
  display: grid;
  place-items: center;
}
.cup-lock .ic { width: 17px; height: 17px; }
.cup-body { grid-area: body; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.cup-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.cup-name { font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif; font-weight: 400; font-size: 20px; line-height: 1.2; letter-spacing: .02em; }
.cup-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 9px 1px 6px; border-radius: 999px; border: 2px solid var(--ink); font-size: 14px; font-weight: 900; white-space: nowrap; }
.cup-badge .ic { width: 15px; height: 15px; }
.cup-badge--won { background: #ffd426; }
.cup-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; }
.cup-rule-lbl { flex-basis: 100%; font-size: 14px; font-weight: 800; color: #6c6450; }
.cup-class { padding: 1px 9px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 900; white-space: nowrap; }
.cup-spec { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; font-weight: 800; color: #343a40; white-space: nowrap; }
.cup-spec .ic { width: 17px; height: 17px; color: var(--ink); }
/* 道のり：1回戦・2回戦・3回戦・決勝の矢羽。勝ったところはチェック、いまの回戦はオレンジ */
.cup-path { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.cup-path i {
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0 6px 0 9px;
  background: #e9e4d4;
  color: #8a826c;
  font-style: normal;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%);
}
.cup-path i:first-child { padding-left: 4px; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.cup-path i.won { background: #2fb36a; color: #fff; }
.cup-path i.won .ic { width: 18px; height: 18px; stroke-width: 3.2; }
.cup-path i.cur { background: #ff6b2b; color: #fff; }
/* らんせんカップ（4人ルール・2026-12-04）：予選・準決勝・決勝の3つ／決まりの1行 */
.cup-path.cup-path--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cup-ffa-rule { font-size: 14px; font-weight: 800; line-height: 1.5; color: #343a40; word-break: auto-phrase; }
.cup-ffa-rule > span { display: inline-block; }
.cup-no.cup-no--ffa { font-size: 13px; }
/* しばりカップ（2026-12-04）：決まりの札。「しばり」の小さな見出し＋決まり（四辺同じ細い枠） */
.cup-sb-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.cup-sb-rule > b,
.vs-sb-rule > b { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 900; line-height: 1.6; }
.cup-cta {
  grid-area: cta;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 48px;
  padding: 0 12px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 3px 0 var(--ink);
}
.cup-cta .ic { width: 20px; height: 20px; stroke-width: 3; }
.cup-card.is-next .cup-cta { background: #ff6b2b; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
/* まだ開いていないカップ：方眼の上に沈んだ影。押せない */
.cup-card.locked {
  grid-template-areas: "art body";
  background: rgba(8, 20, 54, .5);
  border: 3px dashed #4a5f9a;
  box-shadow: none;
  color: #c8d2f2;
  cursor: default;
}
.cup-card.locked:active { transform: none; }
.cup-card.locked .cup-art-wrap { background: #0e1f4d; border-color: #4a5f9a; }
.cup-card.locked .cup-desc { font-size: 14px; font-weight: 800; line-height: 1.5; color: #a9b8e6; }
/* 1段に「カップ・らんせん・しばり」の3枚（2026-12-04 しばりカップで、700px〜は2列、1040px〜は4列だったのを 700px〜3列の縦長カードへ。
   2列だと1つの階級の3枚が段をまたいで並んでいた） */
@media (min-width: 700px) {
  .cup-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .cup-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; grid-template-areas: "art" "body" "cta"; align-items: start; row-gap: 12px; padding: 0 0 14px; }
  .cup-card.locked { grid-template-areas: "art" "body"; grid-template-rows: auto 1fr; }
  .cup-art-wrap { width: auto; height: 136px; border-width: 0 0 3px; border-radius: 0; background-size: 10px 10px, auto; }
  .cup-art { width: 100px; height: 100px; }
  .cup-body, .cup-cta { margin: 0 14px; }
  .cup-no { left: 0; top: 0; min-width: 36px; height: 36px; font-size: 19px; border-radius: 0 0 12px 0; }
  .cup-lock { right: calc(50% - 60px); bottom: 14px; }
  .cup-card.is-next .cup-top { padding-right: 0; }
}
@media (min-width: 1040px) {
  .cup-list { gap: 16px; }
}
@media (max-width: 380px) {
  .cup-name { font-size: 17px; }
  .cup-card.is-next .cup-top { padding-right: 56px; }
  .cup-next-tag { top: 18px; right: -44px; width: 164px; }
}
/* 文節の途中で折らない（Chrome。ほかは普通に折れる） */
.cup-lead, .cup-desc, .free-txt small, .vs-rival-line, .mission-name, .bk-sub { word-break: auto-phrase; }

/* いまの目標：作業メモの紙。目標の絵と、もらえる BP の札 */
.mission-box { background: #fffdf6; border: 3px solid var(--ink); border-radius: 18px; padding: 12px 14px 14px; box-shadow: 0 5px 0 var(--ink); }
.mission-box h3 { margin: 0 0 8px; font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif; font-weight: 400; font-size: 17px; letter-spacing: .03em; }
.mission-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mission-list li { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 10px; border-radius: 12px; border: 2px solid #e6dfc8; background: #fff; font-size: 15px; font-weight: 800; }
.mission-ico { flex: 0 0 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); background: #ffe3e3; color: #e03131; display: grid; place-items: center; }
.mission-ico .ic { width: 18px; height: 18px; }
.mission-name { flex: 1; min-width: 0; }
.mission-bp { flex-shrink: 0; padding: 1px 9px; border-radius: 999px; border: 2px solid var(--ink); background: #fff3bf; color: var(--ink); font-size: 14px; font-weight: 900; white-space: nowrap; }
.mission-empty { justify-content: center; }
@media (min-width: 1040px) {
  .mission-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* れんしゅう（段階2・3.12節。流れは js/tutorial.js） */
/* 2026-12-02 本人「PCだと上に寄っているのはアリ？」→ カップと同じ青焼きの地に、生成りの紙を縦の真ん中へ */
.practice-body { width: min(100%, 600px); margin-block: auto; padding: 22px 20px 20px; background: #fffdf6; border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 6px 0 var(--ink); box-sizing: border-box; }
#scr-practice .scr-head { flex-shrink: 0; }
@media (max-width: 480px) { .practice-body { padding: 16px 14px 14px; } }
/* 分かち書きの空白でだけ折る（「つけ／る」のように語の途中で折れていた） */
.practice-lead, .practice-steps span { word-break: keep-all; overflow-wrap: anywhere; }
.practice-lead { margin: 0; font-size: 16px; font-weight: 800; color: #343a40; line-height: 1.6; text-align: center; }
.practice-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.practice-steps li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border-radius: 16px; border: 3px solid var(--ink); background: #fff; font-size: 16px; font-weight: 800; }
.practice-steps b { flex: 0 0 36px; height: 36px; border-radius: 50%; background: #ffd426; border: 3px solid var(--ink); display: grid; place-items: center; font-size: 17px; }
.practice-steps li.is-done { background: #ebfbee; }
.practice-steps li.is-done b { background: #20c96b; color: #fff; font-size: 0; }
.practice-steps li.is-done b::after { content: ""; width: 20px; height: 20px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m4.5 12.5 5 5L20 7' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
#scr-practice[data-state="done"] .scr-title { font-size: 24px; }
#scr-practice[data-state="done"] .practice-lead { font-size: 17px; }
.practice-badge { display: none; align-self: center; width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--ink); background: #ffd426; box-shadow: 0 5px 0 var(--ink); place-items: center; color: var(--ink); }
.practice-badge svg { width: 56px; height: 56px; }
#scr-practice[data-state="done"] .practice-badge { display: grid; animation: p4Pop .4s ease-out; }
.pc-ph { display: inline-block; }
.pc-layer, .pc-bar { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* れんしゅう中：ガレージの上の帯・号機の切り替え・いろ・おためし・…は出さない（やめる は下の帯） */
#app[data-practice] #garage-bar,
#app[data-practice] #workshop-hud .g-slot,
#app[data-practice] #g-paint,
#app[data-practice] #g-test,
#app[data-practice] #g-more,
#app[data-practice] #g-more-menu { display: none !important; }
/* れんしゅうのバトル：時間は出さない（時間切れにしない）。ポーズからの「やりなおす」「じゅんびへ」は本番の試合になるので出さない */
#app[data-practice] #battle-timer { visibility: hidden; }
#app[data-practice] #btn-pause-rematch,
#app[data-practice] #btn-pause-setup { display: none !important; }

/* 上の帯：やめる＋いまの課題（ガレージの帯のかわり） */
.pc-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) 10px 6px;
  pointer-events: none;
}
.pc-bar[hidden] { display: none !important; }
.pc-bar > * { pointer-events: auto; }
.pc-quit {
  font-family: inherit;
  flex: 0 0 auto;
  min-height: 48px;
  min-width: 84px;
  padding: 0 14px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
.pc-quit:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.pc-task {
  flex: 1;
  min-width: 0;
  margin: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 6px;
  border-radius: 16px;
  border: 3px solid var(--ink);
  background: #fff9db;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
  box-shadow: 0 3px 0 var(--ink);
}
.pc-task b { flex: 0 0 auto; padding: 4px 9px; border-radius: 999px; background: var(--ink); color: #ffd426; font-size: 14px; }
@media (min-width: 720px) { .pc-task { flex: 0 1 auto; } }

/* 止め札：世界を止めて、褒め言葉＋次にやること＋絵。矢印と目印の輪は別の層 */
.pc-layer {
  position: fixed;
  inset: 0;
  /* iOS 26 の下端ツールバーの分は bottom で上げる（--tb の 100% は padding の中だと「幅」に対する割合になるので使わない） */
  bottom: var(--tb, 0px);
  z-index: 120;
  display: flex;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(25, 32, 56, .28);
  touch-action: none;
}
.pc-layer[hidden] { display: none !important; }
.pc-card {
  align-self: center;
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 18px;
  border-radius: 22px;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 0 var(--ink);
  text-align: center;
}
.pc-card[data-pos="top"] { align-self: flex-start; margin-top: 64px; }
.pc-card[data-pos="bottom"] { align-self: flex-end; margin-bottom: 8px; }
.pc-layer.pc-in .pc-card { animation: p4Pop .32s ease-out; }
.pc-step { margin: 0; font-size: 14px; font-weight: 900; color: #e67700; letter-spacing: .04em; }
.pc-head { margin: 0; font-size: 24px; font-weight: 900; line-height: 1.3; }
.pc-text { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.6; color: #343a40; }
.pc-next {
  font-family: inherit;
  margin-top: 4px;
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  border: 3px solid var(--ink);
  background: #ff6b2b;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .06em;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
.pc-next:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.pc-next.is-locked { opacity: .55; }
.pc-art { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; min-height: 56px; }
.pc-art[hidden] { display: none; }
.pc-art-ic { width: 56px; height: 56px; border-radius: 16px; border: 3px solid var(--ink); background: #e7f5ff; display: grid; place-items: center; color: var(--ink); }
.pc-art-ic svg { width: 34px; height: 34px; }
.pc-art-ic--good { background: #fff3bf; color: #e67700; }
.pc-art-plus { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--ink); background: #ffd426; display: grid; place-items: center; }
.pc-art-plus svg { width: 22px; height: 22px; }
.pc-art-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 10px; border-radius: 12px; border: 3px solid var(--ink); font-size: 14px; font-weight: 900; }
.pc-art-chip svg { width: 22px; height: 22px; flex: 0 0 auto; }
.pc-art-chip--cond { background: #d0ebff; }
.pc-art-chip--act { background: #d3f9d8; }
.pc-art-to { font-size: 20px; font-weight: 900; }
.pc-art-pad { width: 60px; height: 60px; border-radius: 50%; border: 3px solid var(--ink); background: #4dabf7; display: grid; place-items: center; }
.pc-art-pad svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.pc-ring,
.pc-arrow { position: fixed; top: 0; left: 0; z-index: 125; pointer-events: none; }
.pc-ring[hidden],
.pc-arrow[hidden] { display: none !important; }
.pc-ring { border-radius: 50%; border: 4px solid #ffd426; box-shadow: 0 0 0 3px var(--ink), 0 0 18px 4px rgba(255, 212, 38, .85); animation: pcRing 1.1s ease-in-out infinite; }
.pc-arrow svg { display: block; animation: pcArrow .9s ease-in-out infinite; }
.pc-arrow--up svg { transform: rotate(180deg); animation-name: pcArrowUp; }
@keyframes pcRing { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes pcArrow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes pcArrowUp { 0%, 100% { transform: rotate(180deg) translateY(0); } 50% { transform: rotate(180deg) translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  .pc-ring, .pc-arrow svg, .pc-arrow--up svg, .pc-layer.pc-in .pc-card { animation: none; }
}

/* ---------- フリーバトル（シート） ---------- */
.scr-sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--tb);
  z-index: 46;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: rgba(25, 32, 56, .55);
  animation: p4Fade .18s ease-out;
}
.scr-sheet-box { width: min(100%, 480px); max-height: 100%; overflow-y: auto; background: #fff; border: 3px solid var(--ink); border-radius: 22px; padding: 12px 14px 16px; box-shadow: 0 6px 0 var(--ink); animation: p4SheetUp .22s ease-out; display: flex; flex-direction: column; gap: 10px; }
/* フリーバトル（2026-12-02 作り直し）：青焼きの箱（.mn-box）に、絵つきの大きなカード3枚。鍵の条件はカードの中 */
.scr-sheet-box.mn-box { padding: 12px 14px 16px; gap: 12px; }
.free-cards { display: grid; gap: 10px; }
.free-card {
  --tile: #a5d8ff;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 10px 12px 10px 10px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #fffdf6;
  color: var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.free-card--ffa { --tile: #ffe066; }
.free-card--duo { --tile: #ffc9de; }
.free-card:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.free-art-tile {
  position: relative;
  flex: 0 0 70px;
  height: 70px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: radial-gradient(circle, rgba(25, 32, 56, .14) 1.4px, transparent 1.9px) 0 0 / 8px 8px, var(--tile);
  display: grid;
  place-items: center;
}
.free-art { display: block; width: 56px; height: 56px; }
.free-lock-badge { display: none; position: absolute; right: -8px; bottom: -8px; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--ink); background: #ffd426; color: var(--ink); place-items: center; }
.free-lock-badge .ic { width: 16px; height: 16px; }
.free-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.free-txt b { font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif; font-weight: 400; font-size: 21px; line-height: 1.2; letter-spacing: .02em; }
.free-txt small { font-size: 14px; font-weight: 800; line-height: 1.45; color: #5c5647; }
.free-lock { display: none; }
.free-go { flex: 0 0 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--ink); background: #ff6b2b; color: #fff; display: grid; place-items: center; }
.free-go .ic { width: 18px; height: 18px; stroke-width: 3.2; }
/* 鍵：沈んだ色・絵に鍵の札・説明のかわりに開く条件。押すと「まだ ひらいていません」の案内（main.js） */
.free-card.locked { background: rgba(8, 20, 54, .5); border: 3px dashed #4a5f9a; box-shadow: none; color: #c8d2f2; }
.free-card.locked:active { transform: none; }
.free-card.locked .free-art-tile { background: #0e1f4d; border-color: #4a5f9a; }
.free-card.locked .free-art { opacity: .35; filter: grayscale(1); }
.free-card.locked .free-lock-badge { display: grid; }
.free-card.locked .free-desc { display: none; }
.free-card.locked .free-lock { display: block; color: #a9b8e6; }
.free-card.locked .free-go { display: none; }

/* ---------- つぎの相手（VS・3.5節） ---------- */
.scr-vs {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--tb);
  z-index: 42;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  pointer-events: none;
}
.scr-vs > * { pointer-events: auto; }
.scr-vs .scr-head { pointer-events: none; }
.scr-vs .scr-head > * { pointer-events: auto; }
.vs-kicker { margin: 0; padding: 7px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 16px; font-weight: 900; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.vs-bottom {
  width: min(100%, 520px);
  max-height: 64%;
  min-height: 0;
  overflow: hidden;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 6px 0 var(--ink);
  animation: p4SheetUp .24s ease-out;
}
/* 送るのは中身だけ。スタートと「出られません」はパネルの下に固定（2026-12-02 通し検査の指摘） */
.vs-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: -4px -6px 0;
  padding: 4px 6px 2px;
}
.vs-bottom > .vs-ng-note,
.vs-bottom > .vs-start { flex: 0 0 auto; }
/* 2026-12-02 作り直し：パネルは青焼きの箱（.mn-box）。グランプリの相手は手配書のような白いカード（顔はあたまの形の絵・とくい／にがて・目盛り） */
.vs-rival { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.vs-rival:not(.is-free) { padding: 10px 12px; border: 3px solid var(--ink); border-radius: 16px; background: #fffdf6; box-shadow: 0 4px 0 var(--ink); }
.vs-rival-face { flex: 0 0 72px; height: 72px; border-radius: 16px; border: 3px solid var(--ink); background: radial-gradient(circle, rgba(255, 255, 255, .28) 1.4px, transparent 1.9px) 0 0 / 8px 8px, var(--c, #ff4988); display: grid; place-items: center; }
.vs-rival-face svg { width: 54px; height: 54px; display: block; filter: drop-shadow(0 2px 0 rgba(25, 32, 56, .35)); }
.vs-rival-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.vs-rival-tag { align-self: flex-start; padding: 0 8px; border-radius: 6px; background: #e03131; color: #fff; font-size: 14px; font-weight: 900; }
.vs-rival-name { font-family: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif; font-weight: 400; font-size: 22px; line-height: 1.2; letter-spacing: .02em; overflow-wrap: anywhere; }
.vs-rival-line { font-size: 14px; font-weight: 800; color: #5c5647; }
.vs-traits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.vs-rival > .vs-traits,
.vs-rival > .vs-stars { flex-basis: 100%; margin-top: -4px; }
/* らんせんカップの VS：相手3台を横に並べる */
.vs-ffa-head { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.vs-ffa-rule { font-size: 16px; font-weight: 900; color: #343a40; }
/* しばりカップの VS：きみのロボの決まり */
.vs-sb-rule { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--ink); background: #fff; font-size: 15px; font-weight: 900; color: #343a40; }
.vs-ffa-list { flex-basis: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vs-ffa-foe { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.vs-ffa-foe .vs-rival-face { flex: none; width: 64px; height: 64px; }
.vs-ffa-name { font-size: 16px; font-weight: 900; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .vs-ffa-foe .vs-rival-face { width: 54px; height: 54px; }
  .vs-ffa-foe .vs-rival-face svg { width: 42px; height: 42px; }
  .vs-ffa-name { font-size: 15px; }
}
/* スマホ：相手のカードを低くし、出るロボまで送らずに見えるように */
@media (max-width: 520px) {
  .vs-bottom { max-height: 70%; }
  .vs-rival:not(.is-free) { gap: 10px; padding: 9px 10px; }
  .vs-rival-face { flex-basis: 58px; height: 58px; border-radius: 14px; }
  .vs-rival-face svg { width: 44px; height: 44px; }
  .vs-rival-name { font-size: 20px; }
  .vs-traits { gap: 4px; }
  .vs-trait { gap: 4px; padding: 1px 7px 1px 2px; }
  .vs-stock { min-height: 58px; }
  .vs-stock .vs-choice-ico { width: 26px; height: 26px; }
  .vs-stock .vs-choice-ico svg { width: 21px; height: 21px; }
}
.vs-trait { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; padding: 2px 9px 2px 3px; border-radius: 999px; background: #fff; border: 2px solid #e6dfc8; }
.vs-trait b { padding: 0 7px; border-radius: 999px; color: #fff; font-size: 13px; }
.vs-trait--good b { background: #2b8a3e; }
.vs-trait--bad b { background: #c92a2a; }
.vs-carry { flex-basis: 100%; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; }
.vs-carry i { flex: 1; height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.vs-carry b { display: block; height: 100%; background: linear-gradient(90deg, #228be6, #38d9a9); }
.vs-stock-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 16px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.vs-edit {
  font-family: inherit;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  font-size: 15px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
.vs-stocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vs-stock {
  font-family: inherit;
  min-height: 64px;
  padding: 6px 4px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #fffdf6;
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  touch-action: manipulation;
}
.vs-stock b { font-size: 16px; }
.vs-stock-state { font-size: 14px; font-weight: 800; color: #2b8a3e; }
.vs-stock.ng .vs-stock-state { color: #c92a2a; }
/* えらんでいるもの：外側の outline は下の影を含まず上へずれて見え、送る枠で切れていた（2026-12-02 本人の指摘）。
   枠と影の色を変え、カードの内側の右上に印を置く。青焼きの箱の上で目立つよう、2026-12-02 の作り直しで黄色の板＋墨の印に */
.vs-stock { position: relative; }
.vs-stock .vs-choice-ico { margin-bottom: 1px; }
.vs-stock.selected { background: #ffd426; border-color: var(--ink); box-shadow: 0 3px 0 var(--ink), inset 0 0 0 2px #fff6c4; }
.vs-stock.selected::after { content: ''; position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23192038'/%3E%3Cpath d='M6.5 12.5l3.6 3.6 7.4-8' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; pointer-events: none; }
.vs-stock:disabled { opacity: .55; box-shadow: none; cursor: default; }
.vs-ng-note { margin: 0; padding: 6px 12px; border-radius: 10px; border: 2px solid var(--ink); background: #ffe3e3; font-size: 14px; font-weight: 800; color: #c92a2a; }
.vs-start {
  font-family: inherit;
  width: 100%;
  min-height: 64px;
  border-radius: 18px;
  border: 3px solid var(--ink);
  background: #ff6b2b;
  color: #fff;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: .06em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
.vs-start:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.vs-start:disabled { background: #ced4da; color: #868e96; text-shadow: none; box-shadow: none; cursor: default; }
#app[data-scr="vs"][data-flow="gp"] #bottom-dock,
#app[data-scr="vs"][data-flow="gp"] #topbar { display: none !important; }
/* フリーバトルの準備（いまの準備のシート）では、グランプリ／1人／2P の切替と形式の切替を出さない（フリーバトルの3枚のカードで選んだため） */
#app[data-flow="free"] #battle-mode-header .vs-mode-switch,
#app[data-flow="free"] #battle-format-pills { display: none !important; }

/* ---------- バトルの HUD と操作（3.7節） ---------- */
#app.in-battle #topbar,
#app[data-scr="battle"] #topbar,
#app[data-scr="result"] #topbar,
#app[data-scr="champion"] #topbar,
#app[data-scr="photo"] #topbar { display: none !important; }
#app.in-battle #bottom-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--tb);
  z-index: 22;
  background: transparent;
  border-top: 0;
  padding: 0 12px max(14px, env(safe-area-inset-bottom));
  pointer-events: none;
}
#app.in-battle #bottom-dock .dock-handle-bar { display: none !important; }
#app.in-battle #battle-live-bar { pointer-events: auto; justify-content: center; }
#app[data-scr="result"] #battle-live-bar,
#app[data-scr="result"] #battle-live-2p,
#app[data-scr="result"] #battle-hud,
#app[data-scr="champion"] #battle-live-bar,
#app[data-scr="champion"] #battle-live-2p,
#app[data-scr="champion"] #battle-hud { display: none !important; }

#battle-hud { top: max(8px, env(safe-area-inset-top)); left: 12px; right: 12px; }
#battle-hud .vs-bars { margin-right: 58px; gap: 6px; }
.hud-pause {
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: 0 3px 0 var(--ink);
  display: grid;
  place-items: center;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
}
.hud-pause svg { width: 24px; height: 24px; fill: var(--ink); }
.hud-pause:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
#battle-hud .fighter-card { padding: 5px 8px; border-width: 2.5px; }
#battle-hud .fighter-header { font-size: 14px; margin-bottom: 4px; }
#player-hp-text,
#enemy-hp-text { display: none; }
#battle-hud .hp-track { position: relative; height: 14px; }
.hp-lag { position: absolute; left: 0; top: 0; height: 100%; width: 100%; background: #fff; transition: width .45s ease .3s; }
#battle-hud .hp-fill { position: relative; z-index: 1; transition: none; }
#battle-hud .vs-badge { width: 48px; height: 48px; font-size: 19px; border-width: 3px; }
#battle-hud .rule-lamps { gap: 5px; margin-top: 4px; }
#battle-hud .rule-lamp { width: 12px; height: 12px; padding: 0; font-size: 0; border-radius: 3px; border: 2px solid var(--ink); background: #e9ecef; }
#battle-hud .rule-lamp.lit,
#battle-hud .rule-lamp.lit-else { background: #ffd426; box-shadow: none; }
#battle-hud .hud-sub-row { display: none; }
#battle-hud .ffa-row { font-size: 13px; }
#battle-hud .ffa-name { font-size: 13px; }
#ffa-header-lbl,
#ffa-alive-lbl { font-size: 13px; }
/* 4人らんせん：せまい画面では「4人らんせん」を出さず「のこり ○台」だけにする（切れて「のこ…」になっていた。2026-12-02） */
#ffa-alive-lbl { flex-shrink: 0; }
@media (max-width: 560px) {
  #ffa-header-lbl { display: none; }
  #enemy-hud-4p .fighter-header { justify-content: flex-start; }
}

#battle-live-bar .live-btns { display: flex; justify-content: center; align-items: flex-end; gap: 20px; flex: 0 0 auto; }
#battle-live-bar .action-pad-btn,
#battle-live-2p .dual-btn {
  position: relative;
  width: 82px;
  height: 82px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink), 0 6px 14px rgba(15, 23, 42, .25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
#battle-live-bar .action-pad-btn:active,
#battle-live-2p .dual-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.pad-ico { display: block; width: 28px; height: 28px; pointer-events: none; }
.pad-ico svg { width: 100%; height: 100%; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pad-lbl { pointer-events: none; }
#battle-live-bar .pad-dash,
#battle-live-2p .pad-dash { background: #74c0fc; }
#battle-live-bar .pad-waza,
#battle-live-2p .pad-waza { background: #ffa94d; }
#battle-live-bar .pad-burst,
#battle-live-2p .pad-burst { background: #e9ecef; color: var(--ink); }
#battle-live-bar .pad-burst::before,
#battle-live-2p .pad-burst::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(#ffd426 calc(var(--g, 0) * 1turn), rgba(25, 32, 56, .28) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  pointer-events: none;
}
#battle-live-bar .pad-burst.ready,
#battle-live-2p .pad-burst.ready { background: linear-gradient(180deg, #ffe066 0%, #ff922b 100%); animation: pulseBurst .65s infinite alternate; }
#battle-live-bar .pad-dash::after,
#battle-live-2p .pad-dash::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(rgba(25, 32, 56, .5) calc(var(--cd, 0) * 1turn), transparent 0);
  pointer-events: none;
  opacity: 0;
}
#battle-live-bar .pad-dash.cooling::after,
#battle-live-2p .pad-dash.cooling::after { opacity: 1; }
/* 手ごたえ（2026-12-03）：ひっさつがたまった瞬間に1回だけ大きくする（光らせない。動きを減らす設定では出さない） */
#battle-live-bar .pad-burst.ready.just-ready,
#battle-live-2p .pad-burst.ready.just-ready { animation: feelBurstPop .38s cubic-bezier(.34, 1.56, .64, 1) 1; }
@keyframes feelBurstPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
/* 決着の間は操作ボタンを隠す（main.js endBattle で付け、startFight で外す） */
#battle-live-bar.is-finished,
#battle-live-2p.is-finished { opacity: 0; pointer-events: none !important; transition: opacity .2s ease-out; }
#battle-live-bar.is-finished *,
#battle-live-2p.is-finished * { pointer-events: none !important; }
.pad-key { display: none; position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); padding: 0 6px; border-radius: 6px; border: 2px solid var(--ink); background: #fff; font-family: inherit; font-size: 14px; font-weight: 800; line-height: 1.3; color: var(--ink); pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .pad-key { display: block; }
  #app.in-battle #bottom-dock { padding-bottom: max(34px, env(safe-area-inset-bottom)); }
}

/* ふたりで：1台を上下で向かい合って持つ（上半分の 2P は180度回す） */
#app.in-battle #battle-live-2p.active {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--tb);
  display: block;
  pointer-events: none;
}
#battle-live-2p .dual-pad-group {
  position: absolute;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}
#battle-live-2p .dual-pad-group.p1 { bottom: max(14px, env(safe-area-inset-bottom)); }
#battle-live-2p .dual-pad-group.p2 { top: max(12px, env(safe-area-inset-top)); transform: rotate(180deg); }
#battle-live-2p .dual-btn { width: 74px; height: 74px; flex: 0 0 auto; pointer-events: auto; }
#battle-live-2p .dual-tag { order: 0; padding: 3px 10px; border-radius: 999px; border: 2px solid var(--ink); color: #fff; font-size: 15px; font-weight: 900; pointer-events: none; }
#battle-live-2p .p1 .dual-tag { background: #228be6; }
#battle-live-2p .p2 .dual-tag { background: #e03131; }
#battle-live-2p .dual-btn.pad-dash { order: 1; }
#battle-live-2p .dual-btn.pad-waza { order: 2; }
#battle-live-2p .dual-btn.pad-burst { order: 3; }
#battle-live-2p .dual-mid { display: none !important; }
#app.in-battle[data-fmt="2p"] #battle-hud { top: calc(max(12px, env(safe-area-inset-top)) + 88px); }
#app.in-battle[data-fmt="2p"] #battle-hud .vs-bars { margin-right: 58px; }

/* ---------- 結果（3.8・3.9節） ---------- */
#app #battle-result {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--tb);
  z-index: 45;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: max(14px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(25, 32, 56, 0) 0%, rgba(25, 32, 56, .12) 35%, rgba(25, 32, 56, .62) 100%);
  overflow-y: auto;
}
#app #battle-result.open { display: flex; }
.result-top { text-align: center; pointer-events: none; }
.result-kicker { display: inline-block; margin: 0 0 6px; padding: 5px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 900; }
#battle-result .result-headline {
  margin: 0;
  font-size: clamp(34px, 10vw, 58px);
  font-weight: 900;
  line-height: 1.15;
  /* 折り返しは空白の所だけ（スマホで「リングアウトで 勝 / ち！」と語の途中で切れていた。2026-12-03） */
  word-break: keep-all;
  overflow-wrap: anywhere;
  color: #fff;
  text-shadow: 4px 0 0 var(--ink), -4px 0 0 var(--ink), 0 4px 0 var(--ink), 0 -4px 0 var(--ink), 3px 3px 0 var(--ink), -3px 3px 0 var(--ink), 3px -3px 0 var(--ink), -3px -3px 0 var(--ink), 0 8px 0 rgba(0, 0, 0, .25);
}
#battle-result[data-tone="win"] .result-headline { color: #ffd426; }
#battle-result[data-tone="champ"] .result-headline { color: #ffd426; }
#battle-result[data-tone="lose"] .result-headline { color: #a5d8ff; }
#battle-result .result-headline.pop { animation: p4Pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
#battle-result .result-card {
  width: min(100%, 470px);
  max-width: none;
  margin-top: auto;
  padding: 14px;
  text-align: left;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: p4SheetUp .3s ease-out;
}
#battle-result .result-sub { margin: 0; font-size: 15px; font-weight: 800; color: #343a40; text-align: center; }
.result-hint { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 16px; border: 3px solid #f59f00; background: #fff9db; }
.result-hint-lead { margin: 0; font-size: 14px; font-weight: 900; color: #e67700; }
.result-hint-text { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; } /* 文節（空白）で折り返す。「ぐるぐ｜る」と切れていた（2026-12-03） */
.result-hint-btn { align-self: flex-start; font-family: inherit; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 3px solid var(--ink); background: #ffd426; color: var(--ink); font-weight: 900; font-size: 16px; box-shadow: 0 3px 0 var(--ink); cursor: pointer; touch-action: manipulation; }
.result-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.rs-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; border: 2px solid #dee2e6; background: #f8f9fa; }
.rs-lbl { font-size: 14px; font-weight: 800; color: #495057; }
.rs-val { font-size: 18px; font-weight: 900; color: var(--ink); }
.rs-item--bp { background: #fff9db; border-color: #ffe066; }
.rw-head { margin: 0 0 6px; font-size: 15px; font-weight: 900; }
.rw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.rw-card { height: 116px; perspective: 700px; }
.rw-card[data-kind="part"],
.rw-card[data-kind="chip"] { height: 168px; }
.rw-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.3, 1.3, .5, 1); }
.rw-card.flip .rw-inner { transform: rotateY(180deg); }
.rw-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px; border: 3px solid var(--ink); border-radius: 14px; text-align: center; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.rw-back { background: repeating-linear-gradient(45deg, #228be6 0 10px, #1c7ed6 10px 20px); color: #fff; }
.rw-q { font-size: 36px; font-weight: 900; text-shadow: 0 2px 0 var(--ink); }
.rw-front { background: #fff; transform: rotateY(180deg); }
.rw-ico { font-size: 26px; line-height: 1.1; }
.rw-kind { font-size: 14px; font-weight: 800; color: #868e96; }
.rw-name { font-size: 15px; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
/* 名前は result.js が行を分け、--n＝長い方の行の文字数。札の幅に合わせて 12〜15px（途中で折らない） */
.rw-front { container-type: inline-size; }
.rw-front .rw-name[style*="--n"] { white-space: nowrap; letter-spacing: -0.02em; font-size: clamp(12px, calc((100cqi - 16px) / (var(--n) * 0.98)), 15px); max-width: 100%; }
.rw-bp { font-size: 14px; font-weight: 900; color: #e67700; }
.rw-try { margin-top: 4px; font-family: inherit; min-height: 44px; padding: 0 12px; border-radius: 999px; border: 3px solid var(--ink); background: #ffd426; color: var(--ink); font-weight: 900; font-size: 15px; cursor: pointer; touch-action: manipulation; }
#battle-result .result-actions { display: flex; flex-direction: column; gap: 8px; }
.res-main {
  font-family: inherit;
  width: 100%;
  min-height: 62px;
  border-radius: 18px;
  border: 3px solid var(--ink);
  background: #ff6b2b;
  color: #fff;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .04em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
#btn-res-rematch.res-main { background: #228be6; }
.res-main:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.res-minor { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.res-minor-btn { font-family: inherit; min-height: 50px; padding: 0 4px; border-radius: 14px; border: 3px solid var(--ink); background: #fff; color: var(--ink); font-weight: 900; font-size: 15px; box-shadow: 0 3px 0 var(--ink); cursor: pointer; touch-action: manipulation; }
.res-minor-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

/* ---------- しゃしん（3.11節） ---------- */
#app #photo-studio-bar.active {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--tb);
  transform: none;
  z-index: 30;
  max-width: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  pointer-events: none;
}
#photo-studio-bar .photo-exit { align-self: flex-start; pointer-events: auto; }
.photo-bottom { pointer-events: auto; width: min(100%, 520px); margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.photo-bgs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
#photo-studio-bar .photo-bg { font-family: inherit; min-height: 44px; min-width: 64px; padding: 0 14px; border-radius: 999px; border: 3px solid var(--ink); background: #fff; color: var(--ink); font-weight: 900; font-size: 15px; box-shadow: 0 3px 0 var(--ink); }
#photo-studio-bar .photo-bg.active { background: #ffd426; }
.photo-shot-row { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.photo-pose { justify-self: start; font-family: inherit; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 3px solid var(--ink); background: #fff; color: var(--ink); font-weight: 900; font-size: 15px; box-shadow: 0 3px 0 var(--ink); cursor: pointer; touch-action: manipulation; }
.photo-pose.active { background: #d0ebff; }
.photo-shutter { width: 86px; height: 86px; border-radius: 50%; border: 4px solid var(--ink); background: #fff; box-shadow: 0 5px 0 var(--ink); display: grid; place-items: center; cursor: pointer; touch-action: manipulation; }
.photo-shutter span { width: 60px; height: 60px; border-radius: 50%; border: 3px solid var(--ink); background: #ff6b2b; pointer-events: none; }
.photo-shutter:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }

/* ---------- 重ねる画面（ずかん・せってい・あそびかた・ポーズ・しゃしんの確認） ---------- */
.modal-box .modal-title { font-size: 19px; }
.modal-head .icon-btn { min-height: 44px; min-width: 72px; padding: 0 14px; font-size: 15px; border-width: 3px; border-radius: 12px; }
.pause-actions { gap: 9px; }
.pause-actions .pause-btn { min-height: 54px; font-size: 17px; }
.subtab-btn,
.help-tab-btn { min-height: 44px; font-size: 15px; }
.setting-row { gap: 10px; }
.setting-label { font-size: 16px; }
.setting-desc { font-size: 14px; }
.setting-btn { min-height: 44px; min-width: 76px; font-size: 15px; }
.setting-btn--danger { background: #ffe3e3; color: #c92a2a; }
/* じゅもんコードを読みこむ前の確認（消すほど強くないので、赤ではなく黄みの札） */
/* .reset-confirm（赤）が後ろに書いてあるので、2つ重ねて強くする */
.reset-confirm.code-confirm { margin-top: 4px; border-color: #ffd43b; background: #fff9db; }
.code-confirm .code-confirm-sub { font-size: 14px; font-weight: 700; color: #475569; }
.code-confirm .code-confirm-sub:empty { display: none; }
.setting-btn--go { background: var(--accent-orange); color: #fff; }
#code-actions[hidden] { display: none !important; } /* 中の style の display:flex に hidden が負けないように */
.setting-row--reset { flex-wrap: wrap; }
.reset-confirm { flex-basis: 100%; padding: 10px 12px; border-radius: 12px; border: 2px solid #ffa8a8; background: #fff5f5; }
.reset-confirm p { margin: 0 0 8px; font-size: 15px; font-weight: 800; }
.reset-confirm-btns { display: flex; justify-content: flex-end; gap: 8px; }
.book-card-head { font-size: 15px; }
.book-card-desc { font-size: 14px; line-height: 1.5; }
.help-card--p4 { display: flex; flex-direction: column; gap: 10px; }
.help-art svg { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto; }
.help-lines { margin: 0; padding-left: 1.2em; font-size: 15px; font-weight: 700; line-height: 1.7; }
.ha-core { fill: #228be6; stroke: var(--ink); stroke-width: 3; }
.ha-wheel { fill: #343a40; stroke: var(--ink); stroke-width: 3; }
.ha-socket { fill: #fff; stroke: #ff6b2b; stroke-width: 3; stroke-dasharray: 4 3; }
.ha-plus { stroke: #ff6b2b; stroke-width: 3; stroke-linecap: round; }
.ha-chip { fill: #d0ebff; stroke: var(--ink); stroke-width: 3; }
.ha-chip2 { fill: #fff3bf; stroke: var(--ink); stroke-width: 3; }
.ha-arrow { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ha-btn1 { fill: #74c0fc; stroke: var(--ink); stroke-width: 3; }
.ha-btn2 { fill: #ffa94d; stroke: var(--ink); stroke-width: 3; }
.ha-btn3 { fill: #ffe066; stroke: var(--ink); stroke-width: 3; }
.ha-cup { fill: #ffd426; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
#modal-photo .photo-actions .cta-battle-btn,
#modal-photo .photo-actions .tool-btn,
#btn-photo-share { min-height: 48px; font-size: 15px; }
/* しゃしんの確認：画像は画面の約6割まで。説明文とボタンが最初の画面に入るように（2026-12-02 通し検査の指摘） */
#modal-photo #photo-preview-img { width: auto; max-width: 100%; max-height: 58vh; max-height: 58svh; object-fit: contain; }
#modal-photo .photo-hint-txt { margin: 0 0 4px; font-size: 14px; font-weight: 800; line-height: 1.5; color: #475569; }
#modal-photo .modal-head { margin-bottom: 8px; }

/* ---------- 低い画面（高さ 640px 以下）・せまい画面 ---------- */
@media (max-height: 640px) {
  #title-screen .title-hero { padding-top: 0; }
  #title-screen .title-logo { width: min(80vw, 440px); }
  .title-main { min-height: 62px; font-size: 24px; }
  .title-second { min-height: 50px; }
  #battle-live-bar .action-pad-btn { width: 72px; height: 72px; }
  .pad-ico { width: 24px; height: 24px; }
  .cup-card { padding: 10px 12px; row-gap: 8px; }
  .cup-cta { min-height: 44px; }
  .free-card { min-height: 80px; }
  /* 低い画面：相手のひとことは省き、出るロボまで送らずに入れる */
  .vs-rival-line { display: none; }
}
@media (max-width: 360px) {
  .t-kids { width: 116px; }
  .t-icon { min-width: 48px; padding: 4px; }
  #battle-live-bar .live-btns { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .scr-page, .scr-sheet, .scr-sheet-box, .vs-bottom, .ld-gate,
  #battle-result .result-card, #battle-result .result-headline.pop { animation: none !important; }
  .rw-inner { transition: none; }
  #battle-live-bar .pad-burst.ready, #battle-live-2p .pad-burst.ready { animation: none; }
  #battle-live-bar .pad-burst.ready.just-ready, #battle-live-2p .pad-burst.ready.just-ready { animation: none; }
}

/* つぎの相手：つよさの★と救済の確認（P4 追記） */
.vs-stars { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; font-size: 14px; font-weight: 800; color: #5c5647; }
.vs-star { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.vs-assist { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 2px solid #ffd43b; background: #fff9db; font-size: 15px; font-weight: 800; }
.vs-assist > span { flex-basis: 100%; }
.vs-assist--on { color: #e67700; }
.vs-assist-btn { font-family: inherit; min-height: 44px; min-width: 88px; padding: 0 14px; border-radius: 999px; border: 3px solid var(--ink); background: #fff; color: var(--ink); font-weight: 900; font-size: 15px; box-shadow: 0 3px 0 var(--ink); cursor: pointer; touch-action: manipulation; }
.vs-assist-btn--yes { background: #ffd426; }

/* タイトルの中央：いままでの白い札（screens.css の .title-hero）をやめ、ロゴを会場の上に直接のせる（P4 追記） */
#title-screen .title-hero { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 3vh 0 0; max-width: none; width: 100%; }
#title-screen .title-logo.rlogo { font-size: 0; }
.t-icon { white-space: nowrap; padding: 4px 3px; border-width: 2.5px; }
.t-kids { width: min(30vw, 116px); padding: 6px 10px; }
@media (min-width: 700px) { .t-kids { width: 160px; } .t-icon { padding: 4px 8px; } }

/* 実況の字幕：バトル中は操作ボタンの上に出す。字は 14px（P4 追記） */
#app.in-battle .commentary-ticker { bottom: calc(118px + env(safe-area-inset-bottom)); font-size: 14px; }
#app.in-battle[data-fmt="2p"] .commentary-ticker { bottom: 50%; transform: translate(-50%, 50%); }
@media (hover: hover) and (pointer: fine) { #app.in-battle .commentary-ticker { bottom: 140px; } }
/* left:50% の絶対配置だと幅が親の半分に縮んで字が「…」で切れるので、中身の幅にする。決着の文字の間は出さない（result.js が付け外し） */
#commentary-ticker, .commentary-ticker { width: max-content; animation-name: tickerIn; }
#commentary-ticker .commentary-text { white-space: normal; }
/* popIn は transform を上書きして、出る瞬間だけ左へずれる（translateX(-50%) が外れる）。scale だけ動かす */
@keyframes tickerIn { 0% { scale: 0.7; opacity: 0; } 100% { scale: 1; opacity: 1; } }
#commentary-ticker.is-finish-quiet { display: none !important; }
.res-minor { grid-template-columns: 1.3fr 1fr 1fr; }
.res-minor-btn { white-space: nowrap; }

/* フリーバトルの準備（つぎの相手の画面を使う・P4 追記） */
#app[data-scr="vs"][data-flow="free"] #bottom-dock,
#app[data-scr="vs"][data-flow="free"] #topbar { display: none !important; }
.vs-choice { flex-basis: 100%; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
/* 見出し：番号の札＋白い字（上から順に えらぶ） */
.vs-choice-head { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.vs-step { flex: 0 0 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); background: #ffd426; color: var(--ink); font-size: 14px; line-height: 1; display: grid; place-items: center; text-shadow: none; }
.vs-choice-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 8px; }
/* PC：フリーの準備は2列（相手｜つよさ・ステージ｜出るロボ）。パネルを広げて送らずに入るように */
@media (min-width: 900px) {
  #app[data-flow="free"] .vs-bottom { width: min(100%, 800px); max-height: 70%; }
  .vs-rival.is-free { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px 18px; }
}
/* 絵：上に置く（右上の選んだ印と重ならない）。顔は色の札、ステージは会場の色 */
.vs-choice-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--ink); flex: 0 0 auto; }
.vs-choice-ico .ic { width: 22px; height: 22px; }
.vs-choice-ico.is-face { border: 2px solid var(--ink); background: var(--c, #e7f5ff); }
.vs-choice-ico.is-face svg { width: 24px; height: 24px; display: block; }
.vs-choice-ico.is-meter { height: 22px; }
.vs-choice-ico.is-arena { border: 2px solid var(--ink); background: #e9ecef; }
.vs-choice-ico.is-arena--normal { background: #b2f2bb; }
.vs-choice-ico.is-arena--ice { background: #d0ebff; }
.vs-choice-ico.is-arena--trampoline { background: #ffd8a8; }
.vs-choice-ico.is-arena--wind { background: #c5f6fa; }
.vs-choice-ico.is-arena--vegas { background: #3b1f6e; color: #ffd426; }
.vs-choice-ico.is-arena--random { background: #fff; }
.vs-choice-btn.has-ico { min-height: 64px; padding: 6px 6px 5px; gap: 3px; }
.vs-choice-btn {
  font-family: inherit;
  min-height: 48px;
  padding: 4px 6px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #fffdf6;
  color: var(--ink);
  font-weight: 900;
  font-size: 15px;
  line-height: 1.2;
  box-shadow: 0 3px 0 var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  touch-action: manipulation;
  overflow-wrap: anywhere;
}
.vs-choice-btn small { font-size: 14px; font-weight: 800; color: #2b8a3e; }
.vs-choice-btn.ng small { color: #c92a2a; }
/* えらんでいるもの：外側の outline は下の影を含まず上へずれて見え、送る枠で切れていた（2026-12-02 本人の指摘）。
   枠と影の色を変え、カードの内側の右上に印を置く */
.vs-choice-btn { position: relative; }
.vs-choice-btn.selected { background: #ffd426; border-color: var(--ink); box-shadow: 0 3px 0 var(--ink), inset 0 0 0 2px #fff6c4; }
.vs-choice-btn.selected::after { content: ''; position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23192038'/%3E%3Cpath d='M6.5 12.5l3.6 3.6 7.4-8' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; pointer-events: none; }
.vs-choice-btn.selected small { color: #1b5e2b; }
.vs-choice-btn.selected.ng small { color: #a51d1d; }
.vs-choice-btn:disabled { opacity: .55; box-shadow: none; cursor: default; }
.vs-choice-btn:disabled small { color: #868e96; }

/* いままでのバトル準備のシート（ガレージの「バトル」から入ったとき）も、押せる所を 44px 以上に（P4 追記） */
#battle-prep-shell .vs-mode-btn,
#battle-prep-shell .arena-pill,
#battle-prep-shell .class-card,
#battle-prep-shell .stage-btn,
#battle-prep-shell .p2-select,
#battle-prep-shell .icon-btn,
#btn-start-fight { min-height: 44px; font-size: 15px; }
#battle-prep-shell .arena-pills { flex-wrap: wrap; }
#battle-prep-shell .battle-mode-row { flex-wrap: wrap; }
#battle-prep-shell .prep-step-head { font-size: 14px; }
#battle-prep-shell .class-card-spec,
#battle-prep-shell .stage-btn-lvl,
#battle-prep-shell .stage-btn div { font-size: 14px !important; }
#bottom-dock .dock-collapse-btn { min-height: 44px; padding: 0 14px; font-size: 14px; }

/* PC で体力の帯が横に伸びすぎないよう、HUD の幅をしぼる（P4 追記） */
@media (min-width: 900px) {
  #battle-hud { left: 50%; right: auto; width: min(calc(100% - 24px), 860px); transform: translateX(-50%); }
}

/* あそびかた：タブは2列、絵は小さめ（P4 追記） */
#modal-help .help-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.help-art svg { max-width: 180px; }

/* 結果：中身が多いときはカードの中だけを縦に送り、操作ボタンはいつもカードの下に見せる（P4 追記） */
#app #battle-result { overflow: hidden; }
#battle-result .result-top { flex: 0 0 auto; }
#battle-result .result-card { flex: 0 1 auto; min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; gap: 8px; padding: 12px 12px 0; }
#battle-result .result-actions { position: sticky; bottom: 0; z-index: 2; background: #fff; padding: 8px 0 12px; margin-top: 2px; }
.result-hint { padding: 8px 12px; gap: 4px; }
.result-hint-text { font-size: 15px; }
.result-hint-btn { min-height: 44px; }
/* 数の欄：中身の幅で並べ、入らない札だけ次の行へ（語の途中で折らない。2026-12-02 通し検査の指摘） */
.result-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.result-stats[hidden] { display: none !important; }
.rs-item { padding: 6px 10px; flex: 1 0 auto; max-width: 100%; min-width: 0; }
.rs-lbl, .rs-val { word-break: keep-all; overflow-wrap: anywhere; }
.rs-val { font-size: 16px; }
.rw-card { height: 100px; }
.rw-card[data-kind="part"], .rw-card[data-kind="chip"] { height: 150px; }
/* 札の高さは表の面の中身に合わせる（固定の高さだと、名前が2行のとき「つけてみる」が下の枠にくっついていた）。
   表は流れの中に置き、裏は表に重ねる。同じ段の札は高さをそろえる */
.rw-card, .rw-card[data-kind="part"], .rw-card[data-kind="chip"] { height: auto; min-height: 100px; display: flex; }
.rw-inner { height: auto; flex: 1; display: flex; }
.rw-front { position: relative; inset: auto; flex: 1; padding: 10px 8px 12px; gap: 3px; }
.rw-try { margin-top: 6px; }
/* もらったものの絵（icons.js の線画・2026-12-02 絵文字から差し替え）。種類ごとに札の色を変える */
.rw-ico { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); background: #fff3bf; color: var(--ink); display: grid; place-items: center; flex: 0 0 auto; }
.rw-ico .ic { width: 20px; height: 20px; }
.rw-card[data-kind="part"] .rw-ico { background: #d0ebff; }
.rw-card[data-kind="chip"] .rw-ico { background: #d3f9d8; }
.rw-card[data-kind="cup"] .rw-ico { background: #ffd426; }
.rw-card[data-kind="mission"] .rw-ico { background: #ffe3e3; color: #c92a2a; }
.rw-card[data-kind="invention"] .rw-ico { background: #fff3bf; color: #e67700; }
.res-main { min-height: 56px; font-size: 21px; }
.res-minor-btn { min-height: 46px; }

/* ずかん：数の欄と案内文を読める大きさに（P4 追記） */
#modal-book .modal-subtabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#modal-book .subtab-btn { padding: 4px; white-space: nowrap; }
#book-stats-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; }
#book-stats-summary .metric-chip { display: flex; flex-direction: column; align-items: center; gap: 0; font-size: 14px; font-weight: 800; }
#book-stats-summary .metric-chip b { font-size: 18px; }
#book-lead-txt { font-size: 14px !important; }
#modal-book .subtab-btn { white-space: normal; line-height: 1.2; }

/* ---------- ゆうしょうの画面（3.9節・P4 追記 2026-12-02）。上：トロフィーと見出し、真ん中：台の上のロボ（3D・P3）、下：ひとことともらったもの ---------- */
#app #champion-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--tb);
  z-index: 46;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: radial-gradient(120% 60% at 50% 30%, rgba(255, 214, 38, .16) 0%, rgba(255, 214, 38, 0) 60%), linear-gradient(180deg, rgba(25, 32, 56, 0) 0%, rgba(25, 32, 56, .1) 40%, rgba(25, 32, 56, .6) 100%);
  overflow: hidden;
}
#app #champion-screen[hidden] { display: none !important; }
.champ-top { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 10px; pointer-events: none; }
.champ-head { display: flex; flex-direction: column; align-items: flex-start; }
.champ-head .result-kicker { margin-bottom: 4px; }
.champ-trophy { flex: 0 0 auto; width: clamp(62px, 17vw, 92px); height: auto; overflow: visible; filter: drop-shadow(0 4px 0 rgba(25, 32, 56, .35)); animation: champTrophyIn .7s cubic-bezier(.3, 1.5, .5, 1) both; }
.champ-trophy .ct-cup, .champ-trophy .ct-stem, .champ-trophy .ct-base { fill: #ffc61a; stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.champ-trophy .ct-handle { fill: none; stroke: var(--ink); stroke-width: 9; stroke-linecap: round; }
.champ-trophy .ct-plate { fill: #4dabf7; stroke: var(--ink); stroke-width: 4; }
.champ-trophy .ct-shine { fill: none; stroke: #fff6c4; stroke-width: 5; stroke-linecap: round; }
.champ-trophy .ct-star { fill: #fff; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
@keyframes champTrophyIn { 0% { transform: translateY(-46px) scale(.5) rotate(-14deg); opacity: 0; } 70% { transform: translateY(4px) scale(1.08) rotate(4deg); opacity: 1; } 100% { transform: none; } }
.champ-headline {
  margin: 0;
  font-size: clamp(40px, 12vw, 62px);
  font-weight: 900;
  line-height: 1.1;
  color: #ffd426;
  text-shadow: 4px 0 0 var(--ink), -4px 0 0 var(--ink), 0 4px 0 var(--ink), 0 -4px 0 var(--ink), 3px 3px 0 var(--ink), -3px 3px 0 var(--ink), 3px -3px 0 var(--ink), -3px -3px 0 var(--ink), 0 8px 0 rgba(0, 0, 0, .25);
  animation: p4Pop .5s .15s cubic-bezier(.3, 1.6, .5, 1) both;
}
.champ-card {
  flex: 0 1 auto;
  width: min(100%, 470px);
  max-height: min(56%, 560px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 0;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 6px 0 rgba(25, 32, 56, .55);
  animation: p4SheetUp .3s ease-out;
}
.champ-sub { margin: 0; font-size: 16px; font-weight: 900; text-align: center; color: var(--ink); }
.champ-rivals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.champ-rivals:empty { display: none; }
.champ-rival { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border: 2px solid #dee2e6; border-radius: 14px; background: #f8f9fa; opacity: 0; transform: translateY(8px); transition: opacity .25s ease-out, transform .25s ease-out; }
.champ-rival.on { opacity: 1; transform: none; }
.champ-face { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--ink); background: var(--c, #ff4988); color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 900; text-shadow: 0 1px 0 var(--ink); }
.champ-rival-txt { display: flex; flex-direction: column; min-width: 0; }
.champ-rival-name { font-size: 14px; font-weight: 900; color: #495057; }
.champ-rival-line { font-size: 14px; font-weight: 800; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.champ-actions { position: sticky; bottom: 0; z-index: 2; display: flex; flex-direction: column; gap: 8px; background: #fff; padding: 8px 0 12px; margin-top: 2px; }
.res-minor.res-minor--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 360px) {
  .champ-rivals { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .champ-trophy, .champ-headline, .champ-card { animation: none !important; }
  .champ-rival { transition: none; }
}

/* ---------- せってい：BGM・効果音の音量（P4 追記 2026-12-02） ---------- */
.setting-row--vol { flex-wrap: wrap; row-gap: 4px; }
.setting-row--vol .setting-label { flex: 0 0 auto; min-width: 4.2em; }
.vol-ctl { flex: 1 1 180px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.vol-ico { flex: 0 0 22px; width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.vol-ico path:first-child { fill: var(--ink); }
.vol-range {
  -webkit-appearance: none; appearance: none;
  flex: 1 1 auto; min-width: 0; height: 44px; margin: 0; background: transparent; cursor: pointer;
  touch-action: none; --fill: 100%;
}
.vol-range:focus-visible { outline: 3px solid var(--accent-blue); outline-offset: 2px; border-radius: 10px; }
.vol-range::-webkit-slider-runnable-track {
  height: 12px; border-radius: 999px; border: 2px solid var(--ink);
  background: linear-gradient(90deg, var(--accent-orange) var(--fill), #e9ecef var(--fill));
}
.vol-range::-moz-range-track { height: 12px; border-radius: 999px; border: 2px solid var(--ink); background: #e9ecef; }
.vol-range::-moz-range-progress { height: 12px; border-radius: 999px; background: var(--accent-orange); }
.vol-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 30px; height: 30px; margin-top: -11px; border-radius: 50%;
  border: 3px solid var(--ink); background: #fff; box-shadow: 0 2px 0 var(--ink);
}
.vol-range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; box-shadow: 0 2px 0 var(--ink); }
.setting-row.is-off .vol-ctl { opacity: .45; }
.setting-desc { word-break: auto-phrase; }
#book-stats-summary .metric-chip span { white-space: nowrap; font-size: 13px; }
#book-lead-txt, .bk-sub, .bk-name, .bk-back-body { word-break: auto-phrase; }
.vol-range:disabled { cursor: not-allowed; }

/* ---------- ずかん：絵つきカードの格子（P4 追記 2026-12-02・DESIGN 3.10） ---------- */
#modal-book .modal-box { max-width: 780px; }
#modal-book .modal-title.mn-plate { font-size: 20px; font-weight: 400; margin-left: 4px; }
#modal-book .modal-subtabs { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
#modal-book .subtab-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 4px 2px; line-height: 1.15; min-height: 48px; }
.bk-tab-lbl { font-size: 15px; font-weight: 900; white-space: nowrap; }
.bk-tab-num { font-size: 13px; font-weight: 800; opacity: .8; }
@media (max-width: 520px) {
  #modal-book .modal-subtabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #modal-book .subtab-btn { grid-column: span 2; }
  #modal-book .subtab-btn:nth-child(4), #modal-book .subtab-btn:nth-child(5) { grid-column: span 3; }
}
/* 2026-12-02 本人の指摘「4カラムは文章がきつい」：絵を左に置いて文を横に流すカード。スマホは1列、広い画面（620px〜）は2列 */
#book-list.bk-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 620px) {
  #book-list.bk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.bk-card {
  font-family: inherit; position: relative; display: flex; flex-direction: column; align-items: stretch;
  min-width: 0; min-height: 84px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 14px;
  background: #f8fafc; color: var(--ink); text-align: left; box-shadow: 0 3px 0 rgba(25, 32, 56, .18);
}
button.bk-card { cursor: pointer; touch-action: manipulation; }
button.bk-card:active { transform: translateY(2px); box-shadow: none; }
.bk-card.is-found { background: #fff9db; border-color: #d9480f; }
.bk-card.is-locked { background: #f1f3f5; border-color: #adb5bd; }
.bk-card.is-equipped { background: #fff3bf; border-color: var(--ink); border-width: 3px; }
.bk-front {
  display: grid; grid-template-columns: 60px minmax(0, 1fr); grid-template-rows: auto auto 1fr;
  grid-template-areas: "art name" "art sub" "art tag"; column-gap: 12px; row-gap: 3px; align-items: start; min-width: 0;
}
.bk-art {
  grid-area: art; flex: 0 0 auto; width: 60px; height: 60px; border-radius: 14px; border: 2px solid var(--ink);
  background: #e7f5ff; display: flex; align-items: center; justify-content: center; gap: 0;
}
.bk-art svg { width: 44px; height: 44px; display: block; }
.bk-art--two svg { width: 34px; height: 34px; }
.bk-art--two svg + svg { margin-left: -8px; }
.bk-art--line { color: var(--ink); background: #fff; }
.bk-art--line svg { width: 34px; height: 34px; }
.bk-art--line.is-done { background: #d3f9d8; color: #2b8a3e; }
.bk-art--line.is-medal { background: #fff3bf; color: #e67700; }
.bk-art--face { background: var(--c, #ff4988); }
.bk-art--face svg { width: 46px; height: 46px; }
.bk-art--face.is-unknown { background: #dee2e6; }
.bk-art--face.is-unknown b { font-size: 30px; font-weight: 900; color: #868e96; }
.bk-card.is-locked .bk-art { background: #e9ecef; border-color: #adb5bd; }
.bk-card.is-locked .bk-art svg { filter: grayscale(1) brightness(.25); opacity: .38; }
.bk-name { grid-area: name; font-size: 16px; font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; }
.bk-sub { grid-area: sub; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 14px; font-weight: 700; line-height: 1.55; color: var(--ink-soft); overflow-wrap: anywhere; }
.bk-trait { display: block; }
.bk-trait b { display: inline-block; margin-right: 4px; padding: 0 6px; border-radius: 999px; background: #fff; border: 1.5px solid var(--ink); font-size: 13px; color: var(--ink); }
.bk-reward { display: inline-block; padding: 1px 9px; border-radius: 999px; background: #fff; border: 2px solid var(--ink); font-size: 13px; font-weight: 900; color: var(--ink); }
.bk-tag {
  grid-area: tag; align-self: start; justify-self: start; display: inline-flex; align-items: center; gap: 3px; margin-top: 3px;
  padding: 2px 9px 2px 5px; border-radius: 999px; background: #fff; border: 2px solid var(--ink);
  font-size: 13px; font-weight: 900; color: var(--ink); pointer-events: none;
}
.bk-tag svg { width: 14px; height: 14px; }
.bk-back { display: none; flex-direction: column; gap: 6px; text-align: left; }
.bk-card.is-back { background: #e7f5ff; border-color: var(--accent-blue); }
.bk-card.is-back .bk-front, .bk-card.is-back .bk-tag { display: none; }
.bk-card.is-back .bk-back { display: flex; }
.bk-back-head { font-size: 15px; font-weight: 900; text-align: center; }
.bk-back-body { font-size: 14px; font-weight: 700; line-height: 1.55; }
.bk-back-hint { font-size: 14px; font-weight: 800; color: var(--ink-soft); text-align: center; }
@media (max-width: 360px) {
  .bk-front { grid-template-columns: 52px minmax(0, 1fr); column-gap: 10px; }
  .bk-art { width: 52px; height: 52px; }
}

/* =========================================================================
   UI・UX 点検の改善（2026-12-03・第1段）
   ========================================================================= */

/* 案10：語の途中で折らない。文はもう文節ごとに空白で区切ってあるので、空白の所だけで折る
   （auto-phrase は Chrome だけ。Safari でも効くよう keep-all にする。空白のない長い語は anywhere で逃がす） */
.help-lines li,
.setting-desc,
.g-modal-lead,
.cup-lead,
.cup-desc,
.free-txt small,
.vs-rival-line,
.mission-name,
.bk-sub,
.bk-back-body,
#book-lead-txt,
.practice-lead,
.practice-steps li span,
.reset-confirm p,
.photo-hint-txt { word-break: keep-all; overflow-wrap: anywhere; }

/* 案6：ポーズの右上「もどる」は「バトルを つづける」と同じなので出さない（Esc・つづけるで閉じる） */
#close-pause { display: none !important; }

/* 案11：ポーズの並び。つづける（大）→ カメラ・音（半分の幅で横並び）→ やりなおす → 抜ける2つ */
#modal-pause .pause-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
#modal-pause .pause-actions > .pause-btn { grid-column: 1 / -1; }
#modal-pause #btn-pause-resume { order: 0; min-height: 60px; font-size: 19px; }
#modal-pause #btn-cam-mode { order: 1; grid-column: auto; padding: 6px 8px; font-size: 15px; }
#modal-pause #btn-pause-sound { order: 2; grid-column: auto; padding: 6px 8px; font-size: 15px; }
#modal-pause #btn-pause-rematch { order: 3; }
#modal-pause #btn-pause-setup { order: 4; }
#modal-pause #btn-pause-title { order: 5; }
#modal-pause #btn-stop-fight { order: 6; }
#modal-pause #btn-cam-mode,
#modal-pause #btn-pause-sound { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#modal-pause .pause-actions > [hidden] { display: none !important; }

/* 案12①：フッターのリンク。1行に収まる PC では押せる範囲を上下に広げる（見た目は変えない）。
   スマホは2〜3行に折れるので、広げると隣の行のリンクと重なる。行を詰める本人の決定（2026-12-02）を優先して据え置き */
@media (min-width: 601px) {
  #title-screen .title-footer-links a { position: relative; }
  #title-screen .title-footer-links a::after { content: ''; position: absolute; left: -6px; right: -6px; top: 50%; height: 44px; transform: translateY(-50%); }
}

/* 案12②：実況の札（9.5px）が小さすぎた */
.commentary-badge { font-size: 13px; }

/* 案12④：写真。「うごく：OFF」が2行に折れていた・背景の札が 4＋1 に割れていた */
.photo-pose { white-space: nowrap; padding: 0 10px; font-size: 14px; }
@media (max-width: 480px) {
  #photo-studio-bar .photo-bg { flex: 0 0 calc((100% - 16px) / 3); min-width: 0; padding: 0 6px; }
}

/* 案12⑤：画質は3つから選ぶ（選んでいるものは黄色の板。押した瞬間に光らせない） */
.setting-row--seg { flex-wrap: wrap; }
.setting-row--seg .setting-info { flex: 1 1 160px; }
.setting-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; flex: 1 1 240px; }
.setting-seg-btn {
  font-family: inherit; min-height: 44px; padding: 0 6px; border-radius: 12px; border: 2.5px solid var(--ink);
  background: #f8fafc; color: var(--ink); font-size: 15px; font-weight: 900; white-space: nowrap;
  box-shadow: 0 3px 0 var(--ink); cursor: pointer; touch-action: manipulation;
}
.setting-seg-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.setting-seg-btn[aria-pressed="true"] { background: var(--accent-yellow, #ffd426); }

/* 案12⑥：スマホのカップ画面。鍵のかかったカップは細い札にして、「いまの目標」を最初の画面に入れる */
@media (max-width: 699px) {
  .cup-card.locked { grid-template-columns: 50px minmax(0, 1fr); column-gap: 10px; padding: 8px 12px; }
  .cup-card.locked .cup-art-wrap { width: 50px; height: 50px; border-radius: 11px; }
  .cup-card.locked .cup-art { width: 38px; height: 38px; }
  .cup-card.locked .cup-lock { width: 26px; height: 26px; right: -6px; bottom: -6px; border-width: 2.5px; }
  .cup-card.locked .cup-lock .ic { width: 14px; height: 14px; }
  .cup-card.locked .cup-body { gap: 2px; }
  .cup-card.locked .cup-name { font-size: 16px; }
  .cup-card.locked .cup-desc { font-size: 14px; line-height: 1.4; }
}

/* 案1：結果・優勝の札を低くして、上に勝ったロボの「窓」を空ける（showcase.js の measureShowcaseWindow が札の上端を測る）。
   もらったものは3列の小さな札。パーツ・チップは札そのものを押すと「つけてみる」（result.js） */
.rw-head { margin: 0 0 4px; font-size: 14px; }
.rw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rw-card, .rw-card[data-kind="part"], .rw-card[data-kind="chip"] { min-height: 88px; }
.rw-front { padding: 8px 5px 9px; gap: 2px; }
.rw-ico { width: 28px; height: 28px; }
.rw-ico .ic { width: 16px; height: 16px; }
.rw-kind { font-size: 13px; line-height: 1.3; }
.rw-card[data-kind="head"] .rw-ico { background: #e5dbff; }
.rw-card--try { cursor: pointer; touch-action: manipulation; border-radius: 14px; }
.rw-card--try:focus-visible { outline: 3px solid var(--accent-blue, #228be6); outline-offset: 2px; }
.rw-try {
  display: inline-flex; align-items: center; min-height: 26px; margin-top: 3px; padding: 0 10px;
  border: 2px solid var(--ink); border-radius: 999px; background: #ffd426; color: var(--ink);
  font-size: 13px; font-weight: 900; white-space: nowrap; pointer-events: none;
}
.champ-rival { padding: 5px 8px; }
@media (max-width: 600px) {
  #battle-result .result-card { padding: 10px 10px 0; gap: 6px; }
  #battle-result .result-sub { font-size: 14px; }
  /* 数の欄は横に流れる札（ラベルと値を1行に） */
  .rs-item { flex-direction: row; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 999px; }
  .rs-lbl { font-size: 13px; }
  .rs-val { font-size: 15px; }
  #battle-result .result-actions,
  .champ-actions { gap: 6px; padding: 6px 0 10px; }
  .res-main { min-height: 52px; font-size: 20px; }
  .res-minor-btn { min-height: 44px; }
  .champ-card { padding: 10px 10px 0; gap: 6px; }
}
/* 低いスマホ（360×640 など）：数の欄が3行に折れ、もらったものが並ぶと札が画面の7割をこえて窓が 44px しか残らなかった。
   札の高さに上限をつけ、あふれた分は札の中で送る（つぎへ などのボタンは下に固定のまま） */
@media (max-width: 600px) and (max-height: 700px) {
  #battle-result .result-card { max-height: 60svh; }
}

/* 案2：開幕の見せ場（名札・回戦・3・2・1）の間は実況のテロップを出さない（名札と重なっていた）。印は js/ui-state.js */
#app.is-fight-intro #commentary-ticker { display: none !important; }

/* 案7：ふたりで。体力の札をそれぞれの手元に置き、2P の札は2P から読める向きにする。時間とポーズは左右の真ん中へ */
#app.in-battle[data-fmt="2p"] #battle-hud {
  top: 0; left: 0; right: 0; bottom: var(--tb, 0px); width: auto; transform: none;
}
#app.in-battle[data-fmt="2p"] #battle-hud .vs-bars { display: contents; margin: 0; }
#app.in-battle[data-fmt="2p"] #battle-hud .fighter-card {
  position: absolute; left: 50%; width: min(calc(100% - 24px), 420px);
}
#app.in-battle[data-fmt="2p"] #battle-hud .fighter-card:first-child {
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 92px); transform: translateX(-50%);
}
#app.in-battle[data-fmt="2p"] #battle-hud .fighter-card:last-child {
  top: calc(max(12px, env(safe-area-inset-top)) + 90px); transform: translateX(-50%) rotate(180deg);
}
#app.in-battle[data-fmt="2p"] #battle-hud .vs-badge { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
#app.in-battle[data-fmt="2p"] #battle-hud .hud-pause { top: 50%; right: 12px; transform: translateY(-50%); }
#app.in-battle[data-fmt="2p"] #battle-hud .hud-pause:active { transform: translateY(calc(-50% + 2px)); }
#app.in-battle[data-fmt="2p"] .commentary-ticker { max-width: calc(100% - 150px); }

/* 案5：いろ・かお。真ん中のモーダルだとロボが隠れて、変えた色が見えなかった。
   スマホは下から出るシート、PC は右の縦長パネルにして、ロボを見ながら選べるようにする（背景の暗さも弱める） */
#modal-paint { background: rgba(25, 32, 56, .16); }
#modal-paint .g-modal-box { animation: p4SheetUp .22s ease-out; }
@media (max-width: 759px) {
  #modal-paint { align-items: flex-end; padding: 0; }
  #modal-paint .g-modal-box {
    max-width: none; width: 100%; max-height: 56svh; border-radius: 22px 22px 0 0; border-bottom-width: 0;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom)); box-shadow: 0 -4px 0 rgba(25, 32, 56, .25);
  }
  #modal-paint .modal-head { margin-bottom: 8px; }
  #modal-paint .g-head-card { min-height: 78px; }
}
@media (min-width: 760px) {
  /* 中身の高さで止める（下まで伸ばすと白い余白が大きく残った）。ボディの色など長いときは中でスクロール */
  #modal-paint { justify-content: flex-end; align-items: flex-start; padding: 76px 12px 12px; }
  #modal-paint .g-modal-box { width: 380px; max-width: 380px; max-height: 100%; }
}
.g-head-card.is-locked { position: relative; justify-content: center; }
.g-head-lock {
  position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--ink); background: #ffd426; color: var(--ink); display: grid; place-items: center;
}
.g-head-lock svg { width: 14px; height: 14px; }
/* 案9：大きい画面（1920×1080 など）。px で決めた HUD・操作・タイトルのボタン・ガレージの道具が画面に対して小さく見えた。
   主な部品の塊だけ 1.25 倍にする（zoom。中の並びは変えない）。パーツの格子・ずのうの盤・重ねる画面は今のまま */
@media (min-width: 1600px) and (min-height: 960px) {
  #battle-hud,
  #battle-live-bar .live-btns,
  #title-screen .title-top,
  #title-screen .title-bottom,
  #garage-bar,
  #workshop-hud,
  #workshop-tools { zoom: 1.25; }
}
.g-head-lock-note { grid-column: 1 / -1; margin: 4px 0 0; font-size: 14px; font-weight: 800; color: #475569; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }

/* =========================================================================
   UI・UX 点検の改善（2026-12-03・第2段）
   ========================================================================= */
/* 案8：PC・横長のガレージ（つくる）。パーツが下の白い帯に1列だけで余白が大きく、ずのう（紺の盤）と別の作品に見えた。
   幅 1040px 以上では、ずのうと同じ左の盤（紺の地・四隅の鋲・同じ枠）に 3 列で入れ、3D に全部の高さを使う。
   ゲージ（おもさ・パーツ・バランス）の下から始める。カードは白のまま。カメラの寄せは main.js の frameGarageCamera が盤の右から測る */
@media (min-width: 1040px) and (orientation: landscape) {
  #app.in-garage:not(.in-garage-prog) { --gp-top: 122px; }
  #app.in-garage:not(.in-garage-prog) #bottom-dock {
    position: absolute;
    left: 12px;
    top: var(--gp-top);
    bottom: calc(12px + var(--tb, 0px));
    width: clamp(352px, 30vw, 420px);
    height: auto;
    min-height: 0;
    color: #e2e8f0;
    border: 3px solid var(--ink);
    border-radius: 22px;
    box-shadow: 0 6px 0 var(--ink), 0 22px 46px rgba(10, 16, 32, 0.36);
    background:
      radial-gradient(circle at 13px 13px, #ffe066 0 3.5px, #8a6a00 4px 5px, transparent 5.5px),
      radial-gradient(circle at calc(100% - 13px) 13px, #ffe066 0 3.5px, #8a6a00 4px 5px, transparent 5.5px),
      radial-gradient(circle at 13px calc(100% - 13px), #ffe066 0 3.5px, #8a6a00 4px 5px, transparent 5.5px),
      radial-gradient(circle at calc(100% - 13px) calc(100% - 13px), #ffe066 0 3.5px, #8a6a00 4px 5px, transparent 5.5px),
      repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 2px, transparent 2px 7px),
      linear-gradient(180deg, #1f2a47 0%, #131b30 100%);
    padding: 14px 16px 14px;
  }
  #app.in-garage:not(.in-garage-prog) #panel-build::before {
    content: 'PARTS BOX';
    align-self: flex-start;
    flex-shrink: 0;
    margin: 0 0 10px;
    padding: 4px 12px 4px 30px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.14em;
    color: #fde68a;
    border-radius: 8px;
    background:
      repeating-linear-gradient(-45deg, #ffd43b 0 5px, #192038 5px 10px) left center / 20px 100% no-repeat,
      rgba(0, 0, 0, 0.3);
    border: 2px solid #0b1020;
    white-space: nowrap;
  }
  #app.in-garage:not(.in-garage-prog) .g-parts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(92px, auto); gap: 8px; padding: 2px 2px 8px; }
  #app.in-garage:not(.in-garage-prog) .g-cat-tabs { grid-auto-columns: minmax(0, 1fr); }
  #app.in-garage:not(.in-garage-prog) .g-cat-tab { flex-direction: column; gap: 0; font-size: 13px; }
}
@media (min-width: 1600px) and (min-height: 960px) and (orientation: landscape) {
  #app.in-garage:not(.in-garage-prog) { --gp-top: 146px; } /* ゲージが 1.25 倍（案9）になる分 */
}
/* 案8 にあわせて：れんしゅうの札は、3D に重ねず左の盤の下に置く（ロボが大きく映るので、上か下に置くと光る輪とかさなった）。
   盤の右からロボを映しているので、ここなら輪・矢印とかさならない */
@media (min-width: 1040px) and (orientation: landscape) {
  body:has(#app.in-garage:not(.in-garage-prog)) .pc-card {
    align-self: flex-end;
    width: calc(clamp(352px, 30vw, 420px) - 8px);
    margin: 0 auto 8px 0;
  }
}
