/* ====== クロゼッタ シンプル版: 画面(タイトル・キャラ選択・ストーリー・対戦前・リザルトほか) ======
   設計: docs/specs/DANCE_ARCH.md §5 / 担当: 画面担当
   - 色・文字は tokens.css の変数だけを使う(透明度は color-mix で変数から作る)
   - グラデーション文字・文字の発光・絵文字は使わない。主ボタンは --pink のベタ塗り1つ
   - 主役は動画とキャラの絵。1画面で伝えることは1つ
   - タップできるものは高さ44px以上 */

/* メニュー画面が出ている間は、後ろのバトルのHUD・レーンを見せない(9/2ギャップ分析の指摘4)。
   data-screen は screens.js の showScreen() が <html> に付け外しする */
html[data-screen] #hud,
html[data-screen] #laneWrap { visibility: hidden; }

.iconSprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ====== 画面の土台 ====== */
.screen, .screen *, .screen *::before, .screen *::after, #toast { box-sizing: border-box; }
.screen {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column;
  padding: calc(8px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg); color: var(--text);
  font-family: var(--font-jp); font-size: var(--fs-m); line-height: 1.5;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
/* 枠が広いとき(横長の画面など)は、中身を縦長の1列にまとめる */
@media (min-width: 520px) {
  .screen { padding-left: max(16px, calc(50% - 224px)); padding-right: max(16px, calc(50% - 224px)); }
}
.screen:focus { outline: none; }
/* 下地のリセットは :where() で強さ0にする(部品のクラスの余白・色が必ず勝つように) */
:where(.screen) :where(p, h1, h2, h3, ol, ul, dl, dd, figure) { margin: 0; padding: 0; }
:where(.screen) :where(ol, ul) { list-style: none; }
:where(.screen) :where(button, select, input) { font-family: inherit; color: inherit; }
.screen :focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.screen img { -webkit-user-drag: none; user-select: none; }

/* 見出し */
.scrHead {
  position: relative; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; gap: 8px;
}
.scrHead .scrTitle {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: var(--fs-l); white-space: nowrap; pointer-events: none;
}
.headSpacer { width: 1px; height: 1px; }
.scrTitleBlock { flex: none; text-align: center; padding: 16px 0 18px; }
.kicker {
  font-family: var(--font-num); font-size: var(--fs-s);
  letter-spacing: .24em; padding-left: .24em; color: var(--gold);
}
.scrTitle { font-weight: 900; font-size: calc(var(--fs-l) * 1.3); line-height: 1.3; letter-spacing: .04em; }
.scrSub { margin-top: 2px; font-size: var(--fs-s); color: var(--text-dim); font-weight: 700; }
.note { font-size: var(--fs-s); line-height: 1.7; color: var(--text-dim); }
/* 文の中の半角スペースを「区切り」にして、ことばの途中で改行しない(入りきらないときだけ折る) */
.note, .howtoList p, .calLead, .calStatus, .vsDesc, .charDesc, .endNext, .endUnlock, #toast {
  word-break: keep-all; overflow-wrap: anywhere;
}
.scrFoot {
  flex: none; margin-top: auto; padding-top: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}

/* ====== ボタン ====== */
.btnMain {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; max-width: 340px; min-height: 56px; padding: 0 24px;
  border: 0; border-radius: 999px;
  background: var(--pink); color: var(--text);
  font-family: var(--font-jp); font-weight: 900; font-size: var(--fs-l); letter-spacing: .06em;
  cursor: pointer; transition: transform .12s ease, filter .12s ease;
}
.btnMain:active { transform: scale(.97); filter: brightness(.92); }
.btnSub {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; max-width: 340px; min-height: 48px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text);
  font-family: var(--font-jp); font-weight: 700; font-size: var(--fs-m);
  text-decoration: none; cursor: pointer;
  transition: background .12s ease;
}
.btnSub:active { background: color-mix(in srgb, var(--text) 10%, transparent); }
.btnDanger { color: var(--miss); border-color: color-mix(in srgb, var(--miss) 55%, transparent); }
.btnBack {
  display: inline-flex; align-items: center; gap: 2px;
  min-height: 44px; padding: 0 12px 0 2px; margin-left: -4px;
  border: 0; border-radius: 999px; background: none;
  color: var(--text-dim); font-weight: 700; font-size: var(--fs-m); cursor: pointer;
}
.btnBack .ico { width: 22px; height: 22px; }
.iconBtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--bg-a55); color: var(--text);
  cursor: pointer;
}
.btnCol { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.btnRow { width: 100%; display: flex; gap: 10px; }
.btnRow > * { flex: 1 1 0; min-width: 0; }

/* 切り替え(むずかしさ・相手の強さ) */
.seg {
  flex: none; display: flex; gap: 3px; padding: 3px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
}
.seg button {
  flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 6px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--text-dim); font-weight: 700; font-size: var(--fs-m); cursor: pointer;
}
.seg button[aria-pressed="true"] {
  color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 16%, transparent);
  box-shadow: inset 0 0 0 1px var(--cyan);
}

/* 小さな印(クリア・リベンジ) */
.crownTag {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; padding: 2px 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 999px;
  color: var(--gold); font-size: var(--fs-s); font-weight: 700;
}
.crownTag .ico { width: 16px; height: 16px; }
.revTag {
  display: inline-flex; align-items: center;
  padding: 3px 12px; border-radius: 999px;
  border: 1px solid var(--pink); color: var(--pink);
  font-size: var(--fs-s); font-weight: 900;
}

/* ====== キャラの絵(切り抜き)。img の位置と大きさは screens.js の cropStyle() が決める ====== */
.pic { position: relative; display: block; overflow: hidden; background: var(--bg-2); }
.pic img { position: absolute; display: block; max-width: none; height: auto; }
.pic-face { width: 48px; height: 48px; flex: none; border-radius: 12px; }
.pic.shadow img { filter: brightness(0); opacity: .8; }

/* ====== タイトル ====== */
#titleScreen { padding: 0; overflow: hidden; }
.titleBg { position: absolute; inset: 0; overflow: hidden; background: var(--bg); }
.titleBg img, .titleBg video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 12%;
}
.titleBg video { opacity: 0; transition: opacity .8s ease; }
.titleBg video.on { opacity: 1; }
.titleVeil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    var(--bg-a50) 0%,
    transparent 15%,
    transparent 40%,
    var(--bg-a78) 60%,
    var(--bg) 86%);
}
.titleGear { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; z-index: 2; }
.titleMain {
  position: relative; margin-top: auto;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 0 16px;
}
.titleLogo { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: inherit; }
.titleLogo img { display: block; width: min(300px, 78vw); height: auto; }
.titleSub {
  font-family: var(--font-num); font-weight: 400; font-size: var(--fs-m);
  letter-spacing: .5em; padding-left: .5em; color: var(--text);
}
.titleActions {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 28px 0;
}
.titleFoot {
  position: relative; padding: 10px 16px calc(10px + var(--safe-b));
  text-align: center; font-size: var(--fs-s); line-height: 1.4; color: var(--text-dim);
}
.footLink {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px;
}

/* ====== あそびかた ====== */
#howtoScreen .scrTitleBlock { margin-top: auto; }   /* 中身を上下のまん中へ */
.howtoFig { flex: none; width: min(100%, 320px, calc(28dvh * 300 / 192)); margin: 0 auto 16px; }
.howtoFig svg { display: block; width: 100%; height: auto; }
.hf-lane { fill: color-mix(in srgb, var(--text) 5%, transparent); }
.hf-laneLine { stroke: var(--line); stroke-width: 1; }
.hf-judge { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.hf-kime { fill: color-mix(in srgb, var(--gold) 20%, transparent); stroke: var(--gold); stroke-width: 1.8; }
.hf-kimeText { fill: var(--gold); font-family: var(--font-jp); font-weight: 900; font-size: 15px; }
.hf-tap { fill: none; stroke: var(--text); stroke-width: 1.8; opacity: .7; }
.hf-cap { fill: var(--text-dim); font-family: var(--font-jp); font-weight: 700; font-size: 12px; }
.howtoList { flex: none; display: flex; flex-direction: column; gap: 10px; }
.howtoList li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--panel);
}
.howtoNum {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--gold); color: var(--gold);
  font-family: var(--font-num); font-size: var(--fs-m);
}
.howtoList p { padding-top: 2px; font-weight: 700; line-height: 1.6; }
.howtoNote { flex: none; margin-top: 14px; text-align: center; }

/* ====== キャラ選択 ====== */
.charHero {
  position: relative; flex: 1 1 auto; min-height: 220px; margin-top: 4px;
  overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2);
}
.charHero img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 8%;
}
.charHero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 55%;
  background: linear-gradient(180deg, transparent, var(--bg-a90));
}
.charHeroText { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1; }
.charName { font-family: var(--font-num); font-size: var(--fs-xl); line-height: 1.1; letter-spacing: .04em; }
.charDesc { margin-top: 2px; font-weight: 700; }
.charProg {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px;
  font-size: var(--fs-s); font-weight: 700; color: var(--text-dim);
}
.charGrid { flex: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.charTile {
  position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; min-height: 44px; padding: 0;
  overflow: hidden; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-2); cursor: pointer;
}
.charTile .pic { position: absolute; inset: 0; }
.charTile::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  border: 2px solid transparent; pointer-events: none;
}
.charTile[aria-pressed="true"]::after { border-color: var(--cyan); }
.charTile.locked { cursor: default; }
.charTile.locked .pic img { filter: brightness(0); opacity: .75; }
.tileQ {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-weight: 900; font-size: var(--fs-s);
}

/* ====== ストーリー ====== */
.charChip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 3px 14px 3px 3px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  color: var(--text); font-size: var(--fs-s); font-weight: 700; cursor: pointer;
}
.chipPic { width: 36px; height: 36px; border-radius: 50%; }
#storyScreen .scrTitleBlock { padding: 10px 0 14px; }
.stageList { flex: none; display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-bottom: 8px; }
.stageRow {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 66px; padding: 8px 12px 8px 8px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  color: var(--text); text-align: left; cursor: pointer;
}
.stageRow:disabled { cursor: default; opacity: .42; }
.stageRow.next { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, var(--bg-2)); }
.stageNum { flex: none; width: 24px; text-align: center; font-family: var(--font-num); font-size: var(--fs-l); color: var(--text-dim); }
.stageText { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.stageName { font-family: var(--font-num); font-size: var(--fs-l); line-height: 1.2; letter-spacing: .03em; }
.stageDesc { font-size: var(--fs-s); color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stageMark {
  flex: none; min-width: 58px;
  display: flex; flex-direction: column; align-items: center;
  font-size: var(--fs-s); font-weight: 700; line-height: 1.2; color: var(--gold);
}
.stageMark .ico { width: 22px; height: 22px; }
.stageMark.lockMark { color: var(--text-dim); }
.nextTag {
  flex: none; padding: 3px 12px; border-radius: 999px;
  background: var(--gold); color: var(--bg);
  font-size: var(--fs-s); font-weight: 900;
}

/* ====== 対戦前(VS) ====== */
/* 2人の絵は空いている高さいっぱいに出す(主役は絵) */
.vsStage { position: relative; flex: 1 1 auto; display: flex; min-height: 260px; max-height: 560px; margin-top: 6px; }
.vsSide { position: relative; width: 53%; }
.vsMe { clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%); }
.vsRival { margin-left: -6%; clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%); }
.vsSide .pic { position: absolute; inset: 0; }
/* 枠の縦横比が画面ごとに変わるので、枠いっぱいに敷いてから頭を中心に少し寄る(--fy = 頭の高さ) */
.pic-vs img {
  inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 0;
  transform: scale(1.3); transform-origin: 50% var(--fy, 18%);
}
.vsSide::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  background: linear-gradient(180deg, transparent, var(--bg-a88));
}
.vsTag { position: absolute; bottom: 10px; z-index: 1; display: flex; flex-direction: column; line-height: 1.15; }
.vsMe .vsTag { left: 12px; }
.vsRival .vsTag { right: 12px; text-align: right; }
.vsWho { font-size: var(--fs-s); font-weight: 700; color: var(--text-dim); }
.vsName { font-family: var(--font-num); font-size: calc(var(--fs-l) * 1.2); letter-spacing: .03em; }
.vsMark {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  font-family: var(--font-num); font-size: calc(var(--fs-xl) * 1.7); line-height: 1;
  color: var(--gold); letter-spacing: .02em; pointer-events: none;
}
.vsInfo { flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 16px; text-align: center; }
.vsDesc { font-weight: 700; font-size: var(--fs-m); }
.vsMeta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.vsMeta li {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 3px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  font-size: var(--fs-s); font-weight: 700;
}
.vsMeta .ico { width: 16px; height: 16px; color: var(--cyan); }

/* ====== 読み込み中・一時停止 ====== */
.centerCol {
  flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center;
}
.loadList { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 8px; margin: 18px 0 6px; }
.loadList li {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
}
.loadLabel { flex: 1 1 auto; text-align: left; font-weight: 700; }
.loadState { font-size: var(--fs-s); font-weight: 700; color: var(--text-dim); }
.loadList li[data-state="ok"] .loadIco, .loadList li[data-state="ok"] .loadState { color: var(--good); }
.loadList li[data-state="warn"] .loadIco, .loadList li[data-state="warn"] .loadState { color: var(--gold); }
.loadList li[data-state="wait"] .loadIco { color: var(--text-dim); }
#pauseScreen { background: var(--bg-a94); }
#pauseScreen .btnCol { margin-top: 24px; }

/* ====== リザルト(後ろのステージを暗い幕ごしに見せる) ====== */
#resultScreen { background: transparent; padding-top: calc(12px + var(--safe-t)); }
.resFallback {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 10%;
}
.resVeil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    var(--bg-a72) 0%,
    var(--bg-a30) 26%,
    var(--bg-a45) 44%,
    var(--bg-a90) 62%,
    var(--bg) 100%);
}
.resTop, .resBody { position: relative; }
.resTop { flex: none; text-align: center; }
.resStage { font-size: var(--fs-s); font-weight: 700; letter-spacing: .08em; color: var(--text-dim); white-space: pre; }
.resOutcome {
  font-family: var(--font-num); font-weight: 400;
  font-size: calc(var(--fs-xl) * 2.8); line-height: 1.05; letter-spacing: .04em;
}
.is-win .resOutcome { color: var(--win); }
.is-lose .resOutcome { color: var(--lose); }
.resBody { flex: none; margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 16px; }
.resScores { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.resSide {
  min-width: 0; padding: 10px 8px 12px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
}
.resSide.lead { border-color: var(--win); }
.resWho { font-size: var(--fs-s); font-weight: 700; color: var(--text-dim); }
.resNum { font-family: var(--font-num); font-size: calc(var(--fs-xl) * 1.3); line-height: 1.15; letter-spacing: .02em; }
.resRival .resNum { color: var(--text-dim); }
.resBonus { font-size: var(--fs-s); font-weight: 700; color: var(--pink); }
.resDetail { width: 100%; display: flex; align-items: center; justify-content: center; gap: 22px; }
.resRank { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.resRankLabel { font-family: var(--font-num); font-size: var(--fs-s); letter-spacing: .2em; padding-left: .2em; color: var(--text-dim); }
.resRankVal { font-family: var(--font-num); font-size: calc(var(--fs-xl) * 1.35); color: var(--gold); margin-top: 4px; }
.resStats { display: grid; grid-template-columns: auto auto; gap: 2px 18px; font-size: var(--fs-s); }
.resStats div { display: flex; justify-content: space-between; gap: 10px; }
.resStats dt { font-family: var(--font-num); letter-spacing: .06em; color: var(--text-dim); }
.resStats dd { font-family: var(--font-num); letter-spacing: .04em; }
.resBadges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.resBadges:empty { display: none; }
.badge {
  display: inline-flex; align-items: center; padding: 2px 12px;
  border: 1px solid var(--gold); border-radius: 999px;
  color: var(--gold); font-size: var(--fs-s); font-weight: 700;
}
.badge.num { font-family: var(--font-num); font-weight: 400; letter-spacing: .08em; }
#resBtns { margin-top: 4px; }

/* ====== エンディング ====== */
.endCol { gap: 10px; padding-top: 12px; }
.endTitle { font-size: calc(var(--fs-xl) * .9); }
.endCast {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  width: 100%; max-width: 380px; margin: 14px 0 10px;
}
.endCast .pic { width: calc((100% - 24px) / 4); height: auto; aspect-ratio: 1; border-radius: var(--r); border: 1px solid var(--line); }
.endCast .pic.me { border-color: var(--gold); }
.endUnlock {
  padding: 10px 16px; border: 1px solid var(--gold); border-radius: var(--r);
  color: var(--gold); font-weight: 900;
}
.endNext { font-weight: 700; color: var(--text-dim); }

/* ====== フリーバトル ====== */
.freeBody { flex: none; display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.fieldLabel {
  display: block; margin-bottom: 6px;
  font-size: var(--fs-s); font-weight: 700; letter-spacing: .08em; color: var(--text-dim);
}
.chipRow {
  position: relative; display: flex; gap: 6px;
  margin: 0 -16px; padding: 2px 16px 4px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.chipRow::-webkit-scrollbar { display: none; }
.faceChip {
  flex: none; width: 62px; padding: 2px 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; background: none; color: var(--text-dim); cursor: pointer;
  scroll-snap-align: start;
}
.faceChip .pic { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line); }
.chipName {
  max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-num); font-size: var(--fs-s); letter-spacing: .02em;
}
.faceChip[aria-pressed="true"] { color: var(--cyan); }
.faceChip[aria-pressed="true"] .pic { border-color: var(--cyan); box-shadow: 0 0 0 2px var(--cyan); }
.selectWrap { position: relative; }
.selectWrap select {
  width: 100%; min-height: 48px; padding: 0 44px 0 18px;
  -webkit-appearance: none; appearance: none;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  color: var(--text); font-weight: 700; font-size: var(--fs-m); cursor: pointer;
}
.selectWrap select option { background: var(--bg-2); color: var(--text); }
.selectWrap::after {
  content: ''; position: absolute; right: 20px; top: 50%;
  width: 8px; height: 8px; pointer-events: none;
  border-right: 1.8px solid var(--text-dim); border-bottom: 1.8px solid var(--text-dim);
  transform: translateY(-70%) rotate(45deg);
}

/* ====== 設定 ====== */
.setBody { flex: none; display: flex; flex-direction: column; gap: 12px; padding: 6px 0 8px; }
.panel {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
}
.panel .btnSub { max-width: none; }
.panelHead { font-size: var(--fs-m); font-weight: 900; color: var(--gold); }
.rangeHead { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; margin-top: 2px; }
.rangeHead output { font-family: var(--font-num); letter-spacing: .04em; color: var(--cyan); }
.screen input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 44px; margin: -6px 0 0; background: transparent; cursor: pointer;
}
.screen input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--line); }
.screen input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; margin-top: -10px; border: 0; border-radius: 50%; background: var(--text);
}
.screen input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
.screen input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--text); }
.switchRow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; font-weight: 700; cursor: pointer;
}
.switch {
  -webkit-appearance: none; appearance: none; flex: none; position: relative;
  width: 52px; height: 30px; margin: 0; border: 0; border-radius: 999px;
  background: var(--line); cursor: pointer; transition: background .15s ease;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--text);
  transition: transform .15s ease;
}
.switch:checked { background: var(--cyan); }
.switch:checked::after { transform: translateX(22px); background: var(--bg); }

/* ====== タイミング調整 ====== */
.calLead { font-weight: 700; }
.calStatus { min-height: 3.2em; font-size: var(--fs-s); font-weight: 700; color: var(--cyan); }
#calibratePad {
  display: flex; align-items: center; justify-content: center;
  width: 200px; height: 200px; margin-top: 18px;
  border: 2px solid var(--pink); border-radius: 50%;
  background: color-mix(in srgb, var(--pink) 10%, transparent);
  color: var(--pink); font-family: var(--font-num); font-size: var(--fs-xl); letter-spacing: .12em;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
#calibratePad.beat { animation: calBeat .18s ease-out; }
@keyframes calBeat {
  0% { transform: scale(1.06); background: color-mix(in srgb, var(--pink) 42%, transparent); }
  100% { transform: scale(1); }
}

/* ====== お知らせ ====== */
/* 上に出す(下の主ボタンを隠さない) */
#toast {
  position: absolute; left: 50%; top: calc(60px + var(--safe-t)); z-index: 40;
  width: max-content; max-width: calc(100% - 32px);
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-2); color: var(--text);
  font-family: var(--font-jp); font-size: var(--fs-s); font-weight: 700; line-height: 1.5; text-align: center;
  opacity: 0; pointer-events: none; transform: translate(-50%, -8px);
  transition: opacity .2s ease, transform .2s ease;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ====== 動きを減らす設定 ====== */
@media (prefers-reduced-motion: reduce) {
  .screen *, .screen *::before, .screen *::after, #toast { transition: none !important; animation: none !important; }
  .titleBg video { display: none; }
}
