﻿:root{
  --cell:128px;
  --clash-ms:1000ms;   /* バトル/合体の演出時間。JS(setSpeed)がx8以上で短縮して書き換える */
}
*{ box-sizing:border-box; margin:0; padding:0; }
/* ページの扱いは姉妹作『ブラインドブーケ』と同じ（仕様書E 第17.6節）。
   html/body を position:fixed＋overflow:hidden で固定し、ページ自体はスクロールも拡大もさせない。
   ゲームは見えている領域いっぱいに fitStage が収める（だから「最大化」ボタンが要らない）。
   ★iOS の 100vh はアドレスバーを除かない大きい値なので使わない。fixed＋inset:0 なら実際に見えている領域に収まる。
   内容が画面より高い画面（きろく等）は #app の中だけでスクロールする。
   touch-action:pan-x pan-y = そのスクロールは許可、ピンチズーム/ダブルタップズームは不可 */
html,body{
  height:100%;
  overflow:hidden;
  overscroll-behavior:none;      /* 引っぱって更新・ページの跳ね返りを出さない */
  touch-action:pan-x pan-y;
  -webkit-user-select:none; user-select:none;
  -webkit-touch-callout:none;    /* タップ時の選択/長押しメニューだけ抑止 */
  -webkit-text-size-adjust:100%; text-size-adjust:100%;   /* iOS が横向きで文字を勝手に大きくするのを止める（HUDが折り返して盤面が縮む原因） */
}
body{
  background:#1a1024;
  color:#f4ecff;
  font-family:'Segoe UI', 'Hiragino Kaku Gothic ProN', 'MS PGothic', sans-serif;
  position:fixed; inset:0;
  image-rendering:pixelated;
}
/* 見えている領域いっぱいの箱。セーフエリア（iPhone のノッチ・下のバー）の内側に収める */
#app{ position:fixed; inset:0; overflow:auto; overscroll-behavior:contain;
  padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);
  /* 左右は広いほうにそろえる（2026-10-31。iPhone 横向きはノッチ側だけ広く、中身が画面の中央から左右へずれていた） */
  padding-left:max(env(safe-area-inset-left,0px), env(safe-area-inset-right,0px));
  padding-right:max(env(safe-area-inset-left,0px), env(safe-area-inset-right,0px)); }
.screen{ display:flex; flex-direction:column; align-items:center; justify-content:safe center; gap:18px; min-height:100%; }   /* safe center：内容が画面より大きい時は上寄せにしてスクロールで全部見えるようにする */
/* プレイ画面は画面ぴったりに収める。ボタン押下(translateY)のはみ出しでスクロールバーが出ないようクリップ。
   盤面(#stageWrap)と操作バー(#hud)を隙間なく重ね、同じ背景で1枚のパネルに見せる（gap:0） */
#playScreen{ overflow:hidden; gap:0; height:100%; }
.hidden{ display:none !important; }

/* ===== サムネイル画面（タイトル前の7秒） =====
   合計7秒＝1秒フェードイン／4秒そのまま／2秒フェードアウト。%は7秒に対する割合（14.29%=1秒, 71.43%=5秒）。
   .run はJS(startSplash)が次フレームで付ける。display:none の解除と同フレームだとアニメが始まらないため */
#splashScreen{ justify-content:center; gap:0; cursor:pointer; }
#splashImg{ max-width:100vw; max-height:100vh; object-fit:contain; opacity:0; image-rendering:auto; }
#splashScreen.run #splashImg{ animation:splashFade 7s linear forwards; }
@keyframes splashFade{ 0%{ opacity:0; } 14.29%,71.43%{ opacity:1; } 100%{ opacity:0; } }

/* サムネイルからタイトルへ移るときだけ、タイトル全体を1秒でフェードインさせる。
   .fade-in はJS(showTitleWithFade)が付け、終わったら外す（付けたままだと「戻る」での復帰時にも再生されてしまう） */
#titleScreen.fade-in{ animation:titleFadeIn 1s linear; }
@keyframes titleFadeIn{ from{ opacity:0; } to{ opacity:1; } }

.game-title{
  font-size:clamp(30px, 10vw, 64px); letter-spacing:2px;   /* 狭い画面でも見切れないよう画面幅に応じて縮小 */
  color:#ffd93b; text-shadow:4px 4px 0 #b5179e, 8px 8px 0 #3a0ca3;
  text-align:center; max-width:96vw;
}
.subtitle{ color:#c9b8ff; text-align:center; max-width:92vw; }
.hint{ color:#9a86c4; font-size:14px; max-width:640px; text-align:center; }
.big-btn{
  font-size:26px; padding:14px 40px; border:none; border-radius:10px;
  background:#f72585; color:#fff; cursor:pointer; box-shadow:0 6px 0 #7209b7;
}
.big-btn:active{ transform:translateY(3px); box-shadow:0 3px 0 #7209b7; }
.big-btn.small{ font-size:17px; padding:9px 18px; box-shadow:0 4px 0 #7209b7; }
.big-btn.help{ background:#4361ee; box-shadow:0 4px 0 #27379e; }
.big-btn.help:active{ box-shadow:0 1px 0 #27379e; }
/* きろく・遊び方・製作者情報は1行に並べ、折り返さない（折り返すと狭い画面で位置がずれて散らばる）。
   幅が足りない画面では、下の @media で文字と余白を詰めて1行に収める */
.title-btns{ display:flex; gap:12px; justify-content:center; flex-wrap:nowrap; max-width:100%; }
.title-btns .big-btn{ white-space:nowrap; flex:0 1 auto; }
@media (max-width:460px){
  .title-btns{ gap:6px; }
  .title-btns .big-btn.small{ font-size:14px; padding:8px 10px; }
}
@media (max-width:340px){
  .title-btns .big-btn.small{ font-size:12px; padding:7px 7px; }
}
.big-btn.credits{ background:#7b2cbf; box-shadow:0 4px 0 #3a0ca3; }
.big-btn.credits:active{ box-shadow:0 1px 0 #3a0ca3; }
.ver{ color:#f4ecff; font-size:12px; text-align:center; margin:2px 0 0; }   /* タイトル最下部のバージョン表記（暗くて見づらかったので本文と同じ明るさに） */
/* 結果画面：プレイヤーのボス顔の頭（真ん中の上）に王冠をのせる。顔と王冠を .sb-facewrap にまとめ、顔を基準に置く */
.score-table .sb-facewrap{ position:relative; display:inline-block; vertical-align:middle; }
.score-table .sb-crown{ position:absolute; top:2px; left:50%;   /* 2026-10-31：顔を121pxにしたら絵の上の余白で冠が浮いたので -18→2px */ transform:translateX(-50%); font-size:32px; line-height:1; pointer-events:none; }

/* 陣営選択 */
/* タイトルの「〇〇ねこで 始める」ボタン。広い画面は4つ横並び、狭い画面は2×2に折り返す */
.title-start{ display:grid; grid-template-columns:repeat(4, auto); gap:12px; justify-content:center; max-width:100%; }
@media (max-width:620px){ .title-start{ grid-template-columns:repeat(2, auto); gap:8px; } }
/* 2026-10-16：枠線を #5a3d80（背景との差 2.11 で形が見えにくい）→ #8f7bd9（5.25）。
   縦の大きさを 10% 小さく（123 → 111px）：上下の余白と枠の太さだけを減らし、猫の絵と文字の大きさは変えない */
.start-cat{
  display:flex; flex-direction:column; align-items:center; gap:2px; min-width:132px;
  background:#2a1b3d; color:#fff; border:2px solid #8f7bd9; border-radius:12px;
  padding:2px 10px; cursor:pointer; font:inherit; box-shadow:0 4px 0 #120a1c;
  transition:transform .1s, border-color .1s;
}
.start-cat:hover, .start-cat:focus-visible{ transform:translateY(-4px); border-color:#ffd93b; outline:none; }   /* 選んでいる札だけ柚子色 */
.start-cat:active{ transform:translateY(3px); box-shadow:0 1px 0 #120a1c; }
.start-cat img{ width:104px; height:104px; margin:-12px 0; image-rendering:pixelated; }   /* 2026-10-31 に 80→104px（1.3倍）。絵の上下は透明なので、増えた24pxを詰めて札の高さは前のまま */
.start-cat .nm{ font-size:16px; font-weight:bold; white-space:nowrap; }

/* 対戦ステージ：基準STAGE(1552px)を、JS(fitStage)が画面サイズに合わせて自動縮小。幅/高さはJSが実寸で上書きする */
/* ステージ全体の窓。fitStageが画面に収めたサイズにJSが上書き。ここはクリップのみ */
#stageWrap{ position:relative; width:960px; height:960px; overflow:hidden; }
/* マップ専用の窓（自然サイズ=盤面BOARD）。
   touch-action:pan-x pan-y=スクロールは許可・ピンチズームは不可（iOS Safari暴走対策） */
#mapViewport{ position:relative; overflow:hidden; touch-action:pan-x pan-y; -webkit-overflow-scrolling:touch; }
/* 盤面を載せる層（quakeで#boardのtransformと競合しないよう別要素にする）。盤上の暗幕（::after）の基準 */
#mapZoom{ transform-origin:top left; width:960px; height:960px; }
#stage{
  position:relative;
  transform-origin:top left;
  background:#241436;
  display:flex; flex-direction:column; align-items:center;   /* 盤面（上）＋チームパネル（下）の縦積み */
}
/* 画面下のチームパネル（上→左→右→下サイドの順に縦並び）。各行＝顔｜バー2本｜カード5枚 */
/* 【重要】#teamPanels と .team-row / .team-cards には position を付けないこと。
   カード飛翔演出は slot.offsetLeft/offsetTop を「#stage 座標」として使うため（playerSlotCenter等）、
   ここに position を付けると offsetParent が #stage から変わり、飛んでいく先が盤面の高さぶんズレる。 */
#teamPanels{ width:100%; display:flex; flex-direction:column; gap:8px; padding:12px 0 0; }
/* 横長画面（JS:fitStage が body.landscape を付ける）：盤面（左）｜チームパネル（右）の横並び。
   HUD はパネルの真下へ JS が絶対配置する（left/top/width は fitStageLandscape が書く）。
   ★#teamPanels に position を付けない注意は横並びでも同じ（padding は position ではないので可） */
body.landscape #stage{ flex-direction:row; align-items:flex-start; }
body.landscape #teamPanels{ flex:0 0 auto; padding:0 0 0 16px; }   /* 左 padding＝JS の PANEL_GAP と一致させる */
body.landscape #playScreen{ position:relative; }
body.landscape #hud{ position:absolute; max-width:none; transform-origin:top left; background:transparent; }   /* 縮小は左上基準（JS:fitStageLandscape）。背景は #stage の色をそのまま見せて盤面と1枚のペインにする */
.team-row{ display:flex; align-items:center; gap:14px; padding:6px 12px; border-radius:12px; }
.team-row.player{ background:rgba(76,201,240,.12); }   /* プレイヤー行を淡く強調 */
.team-row.dead{ opacity:.45; }
.team-face{ width:193px; height:193px; margin:-16px; image-rendering:pixelated; flex:0 0 auto; }
.team-info{ display:flex; flex-direction:column; align-items:flex-start; gap:6px; flex:0 0 auto; }
.hand-label .hl-name, .hand-label .hl-cp{ white-space:nowrap; }   /* 名前・CP のそれぞれは折り返さない（折り返すなら2つの間だけ） */
.hand-label .hl-cp{ margin-left:.25em; }
.hand-label{ font-size:22px; font-weight:bold; white-space:nowrap; color:#ffd93b; }
.hand-label.dead{ color:#ff5d6c; text-decoration:line-through; }
.team-cards{ display:flex; flex-direction:row; gap:12px; flex:1 1 auto; }
.team-row.player .team-cards{ flex:0 0 auto; }   /* 自猫行はカードを詰め、右の余白に「↑」ボタンを均等配置 */
/* ===== チームの段を大きくする（2026-10-16 手札パネル拡大 v5） =====
   盤面とチームの段は 1152px で作って画面幅に縮める（スマホ縦で約 0.33 倍）ので、22px の名前・CP がスマホでは約 7px だった。
   自分の段は2行（1行目＝顔・名前・CP・メーター、2行目＝カード5枚を大きく）、相手の段は1行のまま名前・CP を大きくする。
   空ける高さは操作ボタンを3行に減らして作った。実測：スマホ 390 で 名前 7.4→14.7px・カード 43→67px・マップ 389→385px */
.team-row .hand-label{ white-space:nowrap; }                /* 英語（Black Cat  CP:150）が単語の区切りで折り返し、段が高くなっていた */
.team-row.player{ flex-wrap:wrap; row-gap:10px; }
.team-row.player .hand-label{ font-size:44px; }
.team-row.player .meters{ width:420px; gap:8px; }
.team-row.player .meter{ height:22px; }
.team-row.player .team-cards{ flex:0 0 100%; gap:8px; justify-content:center; }   /* 2026-10-31：カード 1.1 倍のぶん隙間 16→8px */
.team-row.player .card, .team-row.player .card .base{ width:220px; height:220px; }
.team-row.player .card .char{ width:169px; height:169px; }
.team-row.player .card .char.char-terrain{ width:114px; height:114px; }
.team-row.player .card .char.char-big{ width:284px; height:284px; }
.team-row.player .card-count{ font-size:40px; }
.team-row:not(.player){ gap:12px; padding:4px 12px; }
.team-row:not(.player) .team-face{ width:166px; height:166px; margin:-14px; }   /* 2026-10-31：絵の上下左右の透明な余白（約20%）を詰め、置き場は 138px のまま */
.team-row:not(.player) .hand-label{ font-size:38px; }
.team-row:not(.player) .meters{ width:300px; }
.team-row:not(.player) .team-cards{ gap:5px; }   /* 2026-10-31：10→5px */
.team-row:not(.player) .card, .team-row:not(.player) .card .base{ width:132px; height:132px; }
.team-row:not(.player) .card .char{ width:101px; height:101px; }
.team-row:not(.player) .card .char.char-terrain{ width:68px; height:68px; }
.team-row:not(.player) .card .char.char-big{ width:171px; height:171px; }

.card{ position:relative; width:128px; height:128px; image-rendering:pixelated; }
.card .base{ position:absolute; inset:0; width:128px; height:128px; }
.card .char{ position:absolute; left:50%; top:56%; transform:translate(-50%,-50%); width:99px; height:99px; }   /* 地形以外のキャラを1.5倍（66→99px） */
.card .char.char-terrain{ width:66px; height:66px; }   /* 地形カードのキャラは従来サイズのまま */
.card .char.char-big{ width:165px; height:165px; }   /* 特大サカナ：従来キャラ(66px)の2.5倍。128pxカードから少しはみ出す */
.card.empty{ opacity:.28; }
.card.usable{ cursor:pointer; outline:4px solid transparent; border-radius:8px; }
/* 使用時：白い発光 */
@keyframes cardused{
  0%{ box-shadow:0 0 0 0 rgba(255,255,255,0); filter:brightness(1); }
  30%{ box-shadow:0 0 26px 14px rgba(255,255,255,.95); filter:brightness(2.4); }
  100%{ box-shadow:0 0 0 0 rgba(255,255,255,0); filter:brightness(1); }
}
.card.card-used{ animation:cardused .3s ease-out; }
.card.usable:hover{ outline-color:#ffd93b; }
.card.selected{ outline:4px solid #4cc9f0; }

#board{ position:relative; flex:0 0 auto; }   /* 盤面はフロー内（上）に。子レイヤーはinset:0でこの中に重なる */
@keyframes quake{
  0%,100%{ transform:translate(0,0); }
  12%{ transform:translate(-14px,9px); }
  25%{ transform:translate(14px,-10px); }
  38%{ transform:translate(-12px,-11px); }
  52%{ transform:translate(12px,11px); }
  66%{ transform:translate(-9px,7px); }
  80%{ transform:translate(8px,-6px); }
  92%{ transform:translate(-4px,3px); }
}
#board.quake{ animation:quake .6s ease-in-out; }
/* ゲームオーバーの最後：長め＆大きめの地震 */
@keyframes quakebig{
  0%,100%{ transform:translate(0,0); }
  8%{ transform:translate(-24px,15px); }
  18%{ transform:translate(22px,-17px); }
  28%{ transform:translate(-22px,-15px); }
  40%{ transform:translate(24px,16px); }
  54%{ transform:translate(-17px,11px); }
  68%{ transform:translate(15px,-13px); }
  82%{ transform:translate(-9px,7px); }
  92%{ transform:translate(6px,-4px); }
}
#board.quake-final{ animation:quakebig 1.9s ease-in-out; }
/* ダメージを受けたボスの点滅 */
@keyframes bossblink{ 0%,100%{opacity:1} 20%{opacity:.12} 40%{opacity:1} 60%{opacity:.12} 80%{opacity:1} }
.unit.hit, .unit-pw.hit{ animation:bossblink .48s linear; }
/* サカナ等で猫が白く発光 */
@keyframes unitflash{ 0%{ filter:brightness(1); } 30%{ filter:brightness(3) drop-shadow(0 0 10px #fff); } 100%{ filter:brightness(1); } }
.unit.flash img{ animation:unitflash .45s ease-out; }
/* 画面暗転フェード */
#fadeOverlay{ position:fixed; inset:0; background:#000; opacity:0; pointer-events:none; z-index:50; }

/* 猫パンチ：画面を一瞬黄色くフラッシュ */
@keyframes screenflash{ 0%{opacity:0} 15%{opacity:.7} 100%{opacity:0} }
.screen-flash{ position:fixed; inset:0; background:#ffe14d; pointer-events:none; z-index:55; animation:screenflash .3s ease-out forwards; }

/* サカナ等の「+10」演出：中央から全画面へ拡大し0.7秒から透明化 */
@keyframes bigplus{
  0%{ transform:translate(-50%,-50%) scale(.2); opacity:1; }
  70%{ opacity:1; }
  100%{ transform:translate(-50%,-50%) scale(9); opacity:0; }
}
.bigtext{
  position:fixed; left:50%; top:50%; transform:translate(-50%,-50%);
  z-index:60; pointer-events:none;
  display:flex; align-items:center; justify-content:center;
  animation:bigplus 1s ease-in forwards;   /* 顔と文字はこのコンテナごと同じアニメで拡大 */
}
.bigtext-label{
  position:relative; z-index:1; white-space:nowrap;   /* 文字は前面 */
  font-size:120px; font-weight:900; color:#fff;
  text-shadow:0 0 12px #ff9500, 4px 4px 0 #b5179e;
}
.bigtext-face{                                          /* ボス猫の顔は文字の裏側 */
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  z-index:0; width:200px; height:200px; image-rendering:pixelated; opacity:.92;
}
#terrain{ position:absolute; inset:0; image-rendering:pixelated; }
#cardLayer,#tileLayer,#unitLayer,#overlayLayer,#powerLayer{ position:absolute; inset:0; }
#overlayLayer,#cardLayer,#powerLayer{ pointer-events:none; }

/* カードのある場所：マスの端をオレンジで強調。
   以前は cardblink で点滅させていたが、カードは常に10枚あるため
   「無限ループのアニメが常時10個」動き続けてスマホの電池を食っていた（合成が毎フレーム走る）。
   静止した枠＋内側の光で存在感を出し、アニメーションはゼロにする。 */
@keyframes cardblink{ 0%,100%{opacity:.15} 50%{opacity:.9} }   /* 999超メーター用に残す（発生頻度が低く常時ではない） */
.card-mark{ position:absolute; width:var(--cell); height:var(--cell); box-sizing:border-box;
  border:8px solid #ff9500; border-radius:8px; pointer-events:none; opacity:.9;
  box-shadow:inset 0 0 14px 4px rgba(255,149,0,.55); }
/* 枠の左上に「？」（中身はまだ分からない、の目印）。枠と同じオレンジ。地形に負けないよう黒い縁どり */
.card-mark::before{ content:'?'; position:absolute; left:4px; top:-4px;
  color:#ff9500; font:900 44px/1 'Segoe UI', sans-serif;
  text-shadow:-2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000; }

/* 初めて拾ったカードの説明：カードの下に出す吹き出し（5秒。最初と最後の0.5秒でフェード）。
   位置（left/top）と三角の位置（--tail）は JS:showCardTip が書く。幅は JS の CARD_TIP_W と一致させる */
.card-tip{ position:absolute; width:500px; transform:translateX(-50%); z-index:30; pointer-events:none;
  padding:14px 18px; border-radius:14px; background:#fffbe8; color:#2a1a00; border:3px solid #ff9500;
  font-size:26px; font-weight:bold; line-height:1.45; box-shadow:0 6px 0 rgba(0,0,0,.35);
  animation:cardtip 5s linear forwards; }
.card-tip::before{ content:''; position:absolute; top:-19px; left:var(--tail, 50%); margin-left:-14px;
  border:14px solid transparent; border-top:none; border-bottom:18px solid #ff9500; }
.card-tip .ct-how{ margin-top:4px; font-size:21px; color:#b35c00; }   /* 2行目：おすだけ／選んで使う */
@keyframes cardtip{ 0%{ opacity:0 } 10%{ opacity:.75 } 90%{ opacity:.75 } 100%{ opacity:0 } }   /* 5秒の10%＝0.5秒。表示中は75%（裏の盤面やカードが透けて見える） */

/* カードの解放の表示（ゲーム終了時）。暗転 #fadeOverlay(z50) より奥に置き、そのあとの暗転でいっしょに覆う */
#unlockPanel{ position:fixed; inset:0; z-index:45; display:flex; align-items:center; justify-content:center;
  pointer-events:none; opacity:0; transition:opacity .5s ease-out; padding:16px; }
#unlockPanel.show{ opacity:1; }

/* 自分の猫の動画。暗転 #fadeOverlay(z50)・ボスの吹き飛び(z70)より前、写真の拡大(z90)・ヘルプ(z100)より後ろ。
   位置は画面の中央、大きさはマップに合わせて JS が入れる。ボタンは最後のコマの猫の足もと（高さの約8割）の下に置く */
#catVideo{ position:fixed; z-index:80; pointer-events:none; opacity:0; transition:opacity .4s ease-out; }
#catVideo.show{ opacity:1; }
#catVideoImg{ position:absolute; inset:0; width:100%; height:100%; }
#catVideoBtns{ position:absolute; left:0; right:0; top:83%; display:flex; justify-content:center; gap:14px;
  visibility:hidden; opacity:0; transition:opacity .3s ease-out; }
#catVideo.btns #catVideoBtns{ visibility:visible; opacity:1; pointer-events:auto; }
#unlockPanel .ul-box{ display:flex; flex-direction:column; align-items:center; gap:10px; max-width:100%;
  padding:22px 34px; border-radius:18px; background:rgba(26,16,36,.92); border:4px solid #ffd60a;
  box-shadow:0 0 30px rgba(255,214,10,.45); text-align:center; }
#unlockPanel .ul-head{ font-size:26px; font-weight:900; color:#ffd60a; }
#unlockPanel .ul-card{ margin:6px 0; }
#unlockPanel .ul-name{ font-size:32px; font-weight:900; color:#fff; }
#unlockPanel .ul-desc{ font-size:22px; font-weight:bold; color:#f4ecff; }
#unlockPanel .ul-note{ font-size:17px; color:#c9b8e8; }

/* バトル/合併アニメ：対象マスに1/2サイズの猫を向かい合わせて描画（overlayLayer上・1秒） */
.clash{ position:absolute; width:var(--cell); height:var(--cell); pointer-events:none; z-index:15;
  display:flex; align-items:center; justify-content:center; }
.clash.h{ flex-direction:row; }     /* 横侵入＝左右に並べる */
.clash.v{ flex-direction:column; }  /* 縦侵入＝上下に並べる */
.clash-cat{ width:calc(var(--cell) / 2); height:calc(var(--cell) / 2); }
.clash-cat img{ width:100%; height:100%; image-rendering:pixelated; }
/* バトル：横並びは各自を上下に、縦並びは各自を左右に揺らす（開始位相はJSでランダム化） */
@keyframes shakeV{ 0%,100%{ transform:translateY(-5px); } 50%{ transform:translateY(5px); } }
@keyframes shakeH{ 0%,100%{ transform:translateX(-5px); } 50%{ transform:translateX(5px); } }
.clash.battle.h .clash-cat{ animation:shakeV .16s linear infinite; }
.clash.battle.v .clash-cat{ animation:shakeH .16s linear infinite; }
/* 合併：ゆっくり中央へ寄って重なる */
@keyframes mergeR{ from{ transform:translateX(0); } to{ transform:translateX(50%); } }
@keyframes mergeL{ from{ transform:translateX(0); } to{ transform:translateX(-50%); } }
@keyframes mergeD{ from{ transform:translateY(0); } to{ transform:translateY(50%); } }
@keyframes mergeU{ from{ transform:translateY(0); } to{ transform:translateY(-50%); } }
/* 寄る時間は演出時間(--clash-ms)と一致させる。固定1sのままJS側だけ短縮すると、寄りきる前に演出が消える */
.clash.merge.h .slot1{ animation:mergeR var(--clash-ms) ease-in forwards; }
.clash.merge.h .slot2{ animation:mergeL var(--clash-ms) ease-in forwards; }
.clash.merge.v .slot1{ animation:mergeD var(--clash-ms) ease-in forwards; }
.clash.merge.v .slot2{ animation:mergeU var(--clash-ms) ease-in forwards; }

/* ボス突撃演出：マップを50%暗転し、突撃猫とボス猫を3倍で表示（overlayLayer上・3秒） */
.board-dim{ position:absolute; inset:0; background:rgba(0,0,0,.5); pointer-events:none; z-index:14; }
.big-cat{ position:absolute; width:calc(var(--cell) * 3); height:calc(var(--cell) * 3); pointer-events:none; z-index:16; }
.big-cat img{ width:100%; height:100%; image-rendering:pixelated; }

/* 拾ったカードが回転しながら手札へ飛ぶ */
.fly-card{ position:absolute; width:64px; height:64px; z-index:20; pointer-events:none;
  transition:left .72s ease-in, top .72s ease-in; }
.fly-card img{ position:absolute; image-rendering:pixelated; }
.fly-card .fly-base{ inset:0; width:64px; height:64px; }
.fly-card .fly-char{ left:16px; top:18px; width:32px; height:32px; }
/* Steal選択中、奪える相手カードを点滅強調（タップで奪う） */
.card.steal-target{ cursor:pointer; outline:3px solid #ff5cae; outline-offset:-3px; }
/* ★省電力（2026-10-31）：光の大きさ（box-shadow）を動かすと毎フレーム描き直しになる。光は止め絵にして、明るさ（opacity）だけ動かす */
.card.steal-target::after{ content:''; position:absolute; inset:0; border-radius:8px; box-shadow:0 0 16px #ff5cae; pointer-events:none;
  animation:stealpulse .8s ease-in-out infinite; }
@keyframes stealpulse{ 0%,100%{ opacity:.25; } 50%{ opacity:1; } }
.fly-card.flying{ animation:flyspin .72s linear; }
@keyframes flyspin{ from{ transform:rotate(0deg) } to{ transform:rotate(1080deg) } }

.unit{
  position:absolute; left:0; top:0; width:var(--cell); height:var(--cell);
  /* ★省電力：マス間の移動は translate で動かす（JS:positionUnit）。left/top の遷移は動いている間
     毎フレーム レイアウト＋再描画が走るが、translate は GPU の合成だけで動く。
     left/top は translate 非対応の古いブラウザ用に残す（JS が使う側だけが遷移する） */
  transition:translate 1.35s linear, left 1.35s linear, top 1.35s linear;
}
.unit img{ width:var(--cell); height:var(--cell); image-rendering:pixelated;
  transform:scale(1.2); }   /* ボス・移動・寝ている猫の絵を120%に（マスの中心から広げる。当たり判定は .unit の箱のまま） */
.unit.boss img:not(.shield-mark){ transform:scale(1.45); }   /* ボスは大きく（2026-10-31。マップの上で見分けにくかった。1.2→1.32→1.45。マスからはみ出してよい） */
.unit img.shield-mark{ transform:none; }
/* ボスの枠（2026-10-31）：カードが眠っているマスの枠（.card-mark）と同じ形で、「？」は付けない。
   色はボスのパワーで緑→オレンジ→赤へ連続に変わる（JS:refreshUnit が --bf に "r, g, b" を入れる）。猫の絵の下に敷く */
.unit .boss-frame{ display:none; position:absolute; inset:0; box-sizing:border-box;
  border:8px solid rgb(var(--bf, 62, 207, 90)); border-radius:8px; pointer-events:none; opacity:.9;   /* --bf は .unit（親）に JS が入れる。ここで既定値を置くと親の値を隠すので var() の代わりの値にする */
  box-shadow:inset 0 0 14px 4px rgba(var(--bf, 62, 207, 90), .55); transition:border-color .6s, box-shadow .6s; }
.unit.boss .boss-frame{ display:block; }   /* 盾マークも .unit の中の img だが、大きさは変えない */
img{ -webkit-user-drag:none; }   /* 押したまま少し動くと画像ドラッグが始まり click が消える（猫の選択・手札カードが反応しない）。JS の dragstart 抑止と二重 */
/* 猫パワーの数字は #powerLayer（矢印の上）に、猫と同じ箱 .unit-pw を重ねて出す。位置・移動の速さ・表示は JS が猫とそろえる */
.unit-pw{
  position:absolute; left:0; top:0; width:var(--cell); height:var(--cell); pointer-events:none;
  transition:translate 1.35s linear, left 1.35s linear, top 1.35s linear;   /* .unit と同じ（猫と一緒に動く） */
}
.unit-pw .power{
  position:absolute; left:0; right:0; bottom:6px; text-align:center;
  font-size:34px; font-weight:bold; color:#fff;
  text-shadow:2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000;
  pointer-events:none;
}
.unit-pw.boss .power{ bottom:2px; color:#ffe27a; }

/* ==== プレイ中演出A：猫オーラ／ボスの赤い影（項目3・4） ==== */
/* オーラは img の「下」＝地形と猫の間に敷く。z-index:0では positioned要素がinline imgより上に来てしまうため、
   .unit を自前のstacking contextにして .aura を z-index:-1（unit内で最背面・ただし地形より前）に固定する。 */
.unit{ isolation:isolate; }
.unit .aura{
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:140%; height:140%; border-radius:50%; z-index:-1;
  pointer-events:none; opacity:0; display:none;
  background:radial-gradient(circle, rgba(120,220,255,.55), rgba(120,220,255,0) 70%);
  filter:blur(4px);
}
/* ★省電力（2026-10-31）：オーラの無い猫（ほとんど）は部品ごと出さない。以前は透明のまま blur＋will-change で
   全部の猫が GPU の層を1枚ずつ持ち、毎フレームの合成が猫の数だけ増えていた。脈動は animation が層を作る */
.unit.aura1 .aura, .unit.aura2 .aura, .unit.aura3 .aura, .unit.aura-dark .aura, .unit.oneshot .aura{ display:block; }
/* ★省電力：脈動は transform（大きさ）で表す。以前は filter（blur・brightness）を動かしていたが、
   filter のアニメは毎フレーム CPU でスタイル再計算＋描き直しになり、オーラの猫10体で
   メインスレッドが約 90ms/秒 増えていた（2026-10-15 実測）。ぼかしは止め絵にして、transform は GPU の合成だけで動く */
.unit.aura1 .aura{ opacity:.6; width:130%; height:130%; animation:auraPulse 1.6s ease-in-out infinite; }
.unit.aura2 .aura{ opacity:.8; width:155%; height:155%;
  background:radial-gradient(circle, rgba(180,120,255,.6), rgba(180,120,255,0) 70%);
  animation:auraPulse 1.6s ease-in-out infinite; }
.unit.aura3 .aura{ opacity:1; width:180%; height:180%;
  background:radial-gradient(circle, rgba(255,215,80,.7), rgba(255,120,60,0) 72%);
  animation:auraPulse 1.6s ease-in-out infinite; }
@keyframes auraPulse{ 0%,100%{ transform:translate(-50%,-50%) scale(1); } 50%{ transform:translate(-50%,-50%) scale(1.14); } }
/* 弱ったボスの赤い影（通常オーラとは排他。aura-dark2＝瀕死で濃く・速く） */
.unit.aura-dark .aura{ opacity:.85; width:160%; height:160%; filter:blur(5px);
  background:radial-gradient(circle, rgba(255,40,40,.7), rgba(120,0,0,0) 70%);
  animation:auraDark .8s ease-in-out infinite; }
.unit.aura-dark2 .aura{ opacity:1; width:180%; height:180%; animation-duration:.5s; }
@keyframes auraDark{ 0%,100%{ transform:translate(-50%,-50%) scale(1); } 50%{ transform:translate(-50%,-50%) scale(1.2); } }
/* どの敵ボスでも一撃で倒せる猫（JS:refreshUnit が .oneshot を付ける。2026-10-31）：絵を1.3倍（120%→156%。1.5倍は大きすぎた）、金のオーラを大きく速く。
   マスからはみ出してよいので、となりのマスの猫より手前に出す */
.unit.oneshot{ z-index:3; }
#unitLayer{ isolation:isolate; }   /* 猫どうしの z-index を猫の層の中だけで効かせる（パワーの数字・矢印の層より上に出ないように） */
.unit.oneshot img:not(.shield-mark){ transform:scale(1.56); }
.unit.oneshot .aura{ opacity:1; width:200%; height:200%;
  background:radial-gradient(circle, rgba(255,230,90,.85), rgba(255,140,40,.45) 45%, rgba(255,120,40,0) 72%);
  animation:auraPulse 1s ease-in-out infinite; }

/* ==== プレイ中演出A：戦闘パーティクル（項目1） ==== */
.pfx{ position:absolute; width:18px; height:18px; border-radius:50%;
  pointer-events:none; z-index:18; will-change:transform,opacity;
  transform:translate(-50%,-50%); filter:blur(.5px); mix-blend-mode:screen;
  animation:burst var(--clash-ms) ease-out forwards; }   /* 粒子も演出時間に合わせる（高速時に前の粒子が残らない） */
.pfx.battle { background:radial-gradient(#fff,#7fe0ff 60%,transparent); }
.pfx.merge  { background:radial-gradient(#fff,#ffd93b 60%,transparent); }
.pfx.bosshit{ background:radial-gradient(#fff,#ff5bd0 55%,transparent); }
@keyframes burst{
  0%  { opacity:1; transform:translate(-50%,-50%) rotate(var(--ang)) translateX(0)          scale(1);  }
  100%{ opacity:0; transform:translate(-50%,-50%) rotate(var(--ang)) translateX(var(--dist)) scale(.2); }
}

/* ==== プレイ中演出A：ボスとのラストメッセージ（項目2） ==== */
/* width:max-content＝いちばん長い行に合わせた自然な幅にする。
   これが無いと絶対配置の幅が「leftから盤面の右端までの残り」に潰され、端に近い猫のセリフだけが不自然に折り返される */
.last-msg{ position:absolute; width:max-content; max-width:360px; padding:14px 18px;
  font-size:26px; font-weight:bold; line-height:1.4; color:#3a2a10; z-index:22;
  background:#fff; border:4px solid #ffd93b; border-radius:16px;
  box-shadow:0 6px 0 rgba(0,0,0,.35); pointer-events:none; text-align:center;
  line-break:strict; word-break:normal; overflow-wrap:normal;   /* 万一折り返す場合も禁則処理で「ー」「！」が行頭に来ないようにする */
  opacity:0; transform:translate(-50%,-50%); animation:msgIn .4s ease-out both; }
/* セリフは1行ずつこの要素で置く（JS側で「…」「、」の位置に分割済み）。行間を少し詰めて2行を1つのフキダシとして読ませる */
.last-msg .lm-line{ display:block; }
.last-msg .lm-line + .lm-line{ margin-top:-2px; }
.last-msg.boss{ color:#fff; background:#5a1030; border-color:#ff5bd0; }
/* 合体／けんかの説明（毎ゲーム最初の3回ずつ）。マスの上に出す（いちばん上の行だけ下）。3秒、最初と最後の0.3秒でフェード。
   位置は JS:showClashTip。幅の上限は JS の CLASH_TIP_HALF_W×2 と一致させる */
.clash-tip{ position:absolute; width:max-content; max-width:440px; padding:12px 18px; z-index:24; pointer-events:none;
  font-size:24px; font-weight:bold; line-height:1.35; text-align:center; color:#3a2a10;
  background:#fffbe8; border:4px solid #ffb703; border-radius:16px; box-shadow:0 6px 0 rgba(0,0,0,.35);
  line-break:strict; transform:translate(-50%, -100%); animation:clashtip 3s linear forwards; }
.clash-tip.below{ transform:translate(-50%, 0); }
.clash-tip.battle{ border-color:#ff5b5b; }
.clash-tip.move{ animation-duration:5s; }   /* 最初の操作の案内（JS:showMoveTip の MOVE_TIP_MS と一致） */
.clash-tip .ct-line{ display:block; }
.clash-tip .ct-line:first-child{ font-size:28px; color:#c2410c; }
.clash-tip.battle .ct-line:first-child{ color:#d62828; }
@keyframes clashtip{ 0%{ opacity:0 } 10%{ opacity:.75 } 90%{ opacity:.75 } 100%{ opacity:0 } }   /* 3秒の10%＝0.3秒。表示中は75%（裏の猫が透けて見える） */
@keyframes msgIn{
  from{ opacity:0; transform:translate(-50%, calc(-50% + 12px)) scale(.9); }
  to  { opacity:1; transform:translate(-50%,-50%)               scale(1);  } }

/* カリカリエサ効果中の猫：柑橘色の光。猫の絵そのものは薄くしたくないので、
   光は止め絵の drop-shadow、脈動は猫の下に敷いた後光（::after）の opacity で出す（.aura と同じく z-index:-1）。
   ★省電力：filter を動かすと毎フレーム CPU でスタイル再計算＋描き直しになる（スマホの電池を食う）。opacity は GPU の合成だけで動く */
@keyframes fedpulse{ 0%,100%{ opacity:.7; } 50%{ opacity:1; } }
.unit.fed img{ filter:drop-shadow(0 0 10px #ffb74d); }
.unit.fed::after{ content:''; position:absolute; left:50%; top:50%; width:150%; height:150%; transform:translate(-50%,-50%);
  border-radius:50%; z-index:-1; pointer-events:none;
  background:radial-gradient(circle, rgba(255,200,80,.6), rgba(255,167,38,0) 70%);
  animation:fedpulse 1.1s ease-in-out infinite; }

/* ボス退治演出：くるくる回転しながら拡大。約70%サイズで透明化を開始し、画面いっぱい(100vmax)で消滅 */
@keyframes bossdefeat{
  0%   { transform:translate(-50%,-50%) rotate(0deg)    scale(.05); opacity:1; }
  70%  { opacity:1; }
  100% { transform:translate(calc(-50% + var(--dx,0px)), calc(-50% + var(--dy,0px))) rotate(1440deg) scale(1); opacity:0; }
}
.boss-defeat{
  position:fixed; left:50%; top:50%; width:100vmax; height:100vmax;
  image-rendering:pixelated; pointer-events:none; z-index:70;
  animation:bossdefeat 1.3s ease-in forwards;
}

/* ダメージを受けたボスのマスの赤フラッシュ */
@keyframes cellflash{ 0%{opacity:.85} 100%{opacity:0} }
.cell-flash{ position:absolute; width:var(--cell); height:var(--cell); background:#ff2b2b; pointer-events:none; animation:cellflash .5s ease-out forwards; }

/* 起床メーター（寝ている猫の背中あたり・水色・端丸め） */
.wakemeter{ position:absolute; top:12px; left:50%; transform:translateX(-50%); width:88px; height:16px;
  background:rgba(0,0,0,.5); border:2px solid rgba(255,255,255,.5); border-radius:9px; overflow:hidden; display:none; }
.wakemeter .fill{ height:100%; background:#5fd0ff; border-radius:9px; transition:width .2s linear; }

/* 陣営メーター（黄=ボスCP、白=猫合計、0〜999） */
.meters{ display:flex; flex-direction:column; gap:5px; width:180px; margin:2px 0 6px; }
.meter{ position:relative; height:16px; background:rgba(0,0,0,.45); border:2px solid rgba(255,255,255,.35); border-radius:9px; overflow:hidden; }
.meter .fill{ height:100%; border-radius:9px; }
.meter.boss .fill{ background:#ffd93b; }
.meter.total .fill{ background:#ffffff; }
/* 猫合計999超：白バーを点滅（カードのオレンジ枠と同じ点滅） */
.meter.total .fill.over{ animation:cardblink 1s ease-in-out infinite; }

.sel-marker{ position:absolute; width:var(--cell); height:var(--cell); border:6px solid #4cc9f0; box-sizing:border-box; animation:selblink .38s ease-in-out infinite; }   /* 選択中は枠を早い点滅で強調 */
@keyframes selblink{ 0%,100%{ opacity:1; } 50%{ opacity:.15; } }
.dest-marker{ position:absolute; width:var(--cell); height:var(--cell); border:6px dashed #ffd93b; box-sizing:border-box; }
/* 自分の猫の行き先の旗（JS:drawDestArrows）。箱はマスの大きさで、旗は右上に立てる。行き先を決めた瞬間だけ .pop でぴょこっと立つ */
.arrive-flag{ position:absolute; width:var(--cell); height:var(--cell); pointer-events:none; }
.arrive-flag svg{ position:absolute; right:2px; top:2px; transform-origin:8px 61px; filter:drop-shadow(1px 2px 0 rgba(0,0,0,.35)); }
@keyframes flagpop{ 0%{ transform:scale(0); } 55%{ transform:scale(1.6); } 100%{ transform:scale(1); } }
.arrive-flag.pop svg{ animation:flagpop .6s ease-out; }
#board.targeting{ cursor:crosshair; }

/* HUD幅はJS(fitStage)がゲーム幅に合わせて設定。中身は中央寄せで折り返す。
   盤面と同じ背景色＋隙間ゼロで、盤の下端に直接つながる操作バーとして一体表示する */
#hud{ margin-top:0; position:relative; display:flex; flex-direction:column; align-items:center; gap:6px; max-width:100vw;
  background:#241436; padding:8px 0 10px; }
#statusMsg{ font-size:16px; color:#c9b8ff; text-align:center; }
/* 縦画面：メッセージ欄は2行ぶんの高さに固定する（2026-10-28 iPhone の Chrome）。
   盤面の倍率は fitStage がメッセージ欄の高さを測って決めるので、あとから2行に折り返すと #hud が伸び、
   高さ100%の #playScreen の中で #stageWrap が押し縮められて、いちばん下のチームパネル（白ねこ）が切れていた。
   横画面のスマホ（下の body.landscape:not(.is-pc)）と同じく高さを決め打ちし、3行目は切る。盤面の窓は縮ませない */
body:not(.landscape) #statusMsg{ line-height:1.4; height:2.8em; overflow:hidden; display:flex; align-items:center; justify-content:center; }
#stageWrap{ flex-shrink:0; }
/* ===== 操作ボタン：UIデザインの基準 虎の巻に合わせる（2026-10-16） =====
   完成予想図: 結果/プレイ画面UI改善_完成予想図_261016.html
   以前は ポーズ＝青・ヘルプ＝オレンジ・回転＝緑・タイトルへ＝紫・選択中＝ピンクと色分けしていた（白文字との差 1.91〜3.78、
   四角いボタンの塗りと背景 1.97、高さ 27〜32px）。いまは全部を同じ脇役の形にそろえ、違いは状態だけで出す：
   脇役＝紫の塗り＋枠（文字 11.76・枠と背景 4.89）／選択中＝明るい紫＋柚子色の枠（文字 7.21）／
   主役＝一時停止中の「再開」だけ柚子色。押せる高さは 44px（並びは下の v5 の説明） */
/*   [⏸ ポーズ] [❓ ヘルプ] [⏭ 決着] [🔊]   … 決着は取り消せないので押すと確認ダイアログ
   「タイトルへ」は対戦画面から外し、記録を残さずにやめる道は決着の確認ダイアログの中に置いた */
#pauseBtn, #helpBtn, #skipBtn{
  min-height:44px; padding:0 12px; border:2px solid #8f7bd9; border-radius:10px; background:#3b2d6e; color:#fff;
  font-size:15px; font-weight:bold; white-space:nowrap; cursor:pointer; box-shadow:0 3px 0 #120a1c; }
#pauseBtn:active, #helpBtn:active, #skipBtn:active{ transform:translateY(2px); box-shadow:0 1px 0 #120a1c; }

/* ===== ポーズ・ヘルプ・決着・言語の行 =====
   .hud-btns という専用の行にまとめて必ず横並びにする（ポーズとヘルプは同じ幅）。
   横幅 360px の小さいスマホでも収まるよう、間隔は 6px（実測で右端 352px） */
.hud-btns{ display:flex; gap:6px; align-items:center; justify-content:center; width:min(100%, 380px); padding:0 2px; box-sizing:border-box; }
.hud-btns #pauseBtn, .hud-btns #helpBtn{ flex:1 1 0; padding:0 8px; }
.hud-btns #skipBtn{ padding:0 8px; }
.hud-btns .lang-btn.hud-lang{ min-height:44px; padding:0 6px; border-radius:10px; }
/* 消音ボタンを足したぶん、幅 400px 以下の縦画面では間隔と左右の余白を詰めて1行に収める（360px で実測） */
@media (max-width:400px){
  body:not(.landscape) .hud-btns{ gap:4px; }
  body:not(.landscape) .hud-btns #pauseBtn, body:not(.landscape) .hud-btns #helpBtn, body:not(.landscape) .hud-btns #skipBtn{ padding:0 4px; }
  body:not(.landscape) .hud-btns .lang-btn.hud-lang{ padding:0 4px; }
  body:not(.landscape) .hud-btns button.lang-btn.mute-btn{ min-width:38px; padding:0; }
}
/* 「⏭ 決着」の確かめ。猫の動画(z80)・製作者情報(z95)より前、ヘルプ(z100)より後ろ */
#quitOverlay, #timeUpOverlay{ position:fixed; inset:0; z-index:96; display:flex; align-items:center; justify-content:center;
  padding:16px; background:rgba(0,0,0,.7); animation:pzFade .2s ease-out; }
.quit-box{ width:min(92vw, 420px); box-sizing:border-box; padding:22px 18px 14px;
  background:#241a4d; border:4px solid #7209b7; border-radius:16px; box-shadow:0 12px 34px rgba(0,0,0,.65);
  display:flex; flex-direction:column; align-items:center; gap:12px; text-align:center; animation:pzIn .25s ease-out; }
.quit-msg{ color:#fff; font-size:20px; font-weight:900; line-height:1.5; white-space:pre-line; }   /* 辞書の \n で改行する */
.quit-note{ color:#c9b8ff; font-size:15px; font-weight:bold; margin-top:-6px; }          /* 文字と箱 8.86 */
.quit-btns{ display:flex; gap:14px; justify-content:center; flex-wrap:wrap; margin-top:4px; }
.quit-btns .big-btn{ min-height:48px; padding:0 18px; border-radius:10px; font-size:17px; font-weight:bold; }
/* 決着する＝脇役（紫）。つづける＝主役（柚子色。押し間違えて開いたとき、いちばん押しやすいのが何も起きないボタン） */
#quitYesBtn{ background:#3b2d6e; color:#fff; border:2px solid #8f7bd9; box-shadow:0 3px 0 #120a1c; }
#quitNoBtn{ background:linear-gradient(180deg,#ffd93b,#f2b705); color:#241a4d; border:2px solid #b58a00; box-shadow:0 3px 0 #b58a00; }
#quitYesBtn:active, #quitNoBtn:active{ transform:translateY(2px); }
/* 時間切れ（2026-10-31）。ボタンは1つだけなので、つづける と同じ主役の色 */
.timeup-msg{ color:#e9e1ff; font-size:16px; font-weight:bold; line-height:1.6; white-space:pre-line; }
#timeUpOkBtn{ background:linear-gradient(180deg,#ffd93b,#f2b705); color:#241a4d; border:2px solid #b58a00; box-shadow:0 3px 0 #b58a00; }
#timeUpOkBtn:active{ transform:translateY(2px); }
/* きろくを残さずタイトルへ＝控え（文字だけ・下線）。押せる高さは 44 を確保（文字と箱 8.86） */
#quitTitleBtn{ min-height:44px; padding:0 8px; border:none; background:none; color:#c9b8ff; cursor:pointer;
  font:inherit; font-size:15px; font-weight:bold; text-decoration:underline; text-underline-offset:4px; }
#pauseBtn.paused{ background:linear-gradient(180deg,#ffd93b,#f2b705); color:#5a3d00; border-color:#b58a00; box-shadow:0 3px 0 #b58a00; }   /* 再開待ち＝主役（柚子色。文字 5.49〜7.25） */

/* ===== 暗転（次にタップすべき対象だけを残して、画面のそれ以外を暗くする）=====
   どの領域を暗くするかはJS(refreshDim)がbodyのクラスで指示する：
     dim-map        … 盤面を暗転（猫/マスをタップしない場面）
     dim-panels     … カードエリアを暗転（相手カードをタップしない場面）
     dim-hud        … HUD（案内文・ボタン）を暗転
     dim-keeppause  … ポーズ中＝ポーズボタンだけは明るく残す
   暗幕は「暗くしたい領域そのものの::after」で敷く。#stageがtransformで独自の重なり文脈を作るため、
   画面全体を覆う1枚のオーバーレイ方式では中の対象をz-indexで手前に出せない（この構造では効かない）。
   ただしカードエリアだけは::after方式が使えない（position付与＝飛翔演出の座標基準が壊れる）ので opacity で暗くする。 */
#mapZoom{ position:relative; }                     /* 盤面の暗幕の基準（transformで既に包含ブロックだが明示する） */
#mapZoom::after, #hud::after{
  content:''; position:absolute; inset:0; background:rgba(0,0,0,.62);
  opacity:0; pointer-events:none; transition:opacity .18s;
}
#mapZoom::after{ z-index:120; }                    /* 盤上の演出（.rank-badge=70等）より手前に重ねる */
#hud::after{ z-index:79; }                         /* HUDのボタン（ポーズ/ヘルプ/決着/消音）をまとめて覆う */
body.dim-map #mapZoom::after{ opacity:1; }
body.dim-hud #hud::after{ opacity:1; }
/* カードエリアは不透明度を落として暗転（position/レイアウト・offsetParentに影響しない・合成が最も軽い方法）。
   下地は#stageの暗い背景色なので、黒い暗幕をかけたのとほぼ同じ見た目になる */
#teamPanels{ transition:opacity .18s; }
body.dim-panels #teamPanels{ opacity:.4; }
/* ポーズ中は、ポーズ（再開）ボタンだけを暗幕より前面に出して明るく残す */
body.dim-keeppause #pauseBtn{ position:relative; z-index:81; }
/* 操作の指示文（「目的地のマスをクリック」等）は暗転中も読めるよう暗幕より手前に出す */
body.dim-hud #statusMsg{ position:relative; z-index:81; }

/* ===== 省電力：見ていない間／止めている間はアニメを進めない（body.anim-hold）=====
   CSSアニメはコンポジタが画面のリフレッシュレートで進めるため、ゲームを止めていても
   タブを裏にしていても回り続け、そのぶん電池を消費する。animation-play-state:paused で
   進行そのものを止める（transitionには影響しないので、猫の移動は復帰後もそのまま続く）。 */
body.anim-hold *, body.anim-hold *::before, body.anim-hold *::after{ animation-play-state:paused !important; }


/* ===== ヘルプオーバーレイ（別HTMLをiframeで全画面表示）===== */
#helpOverlay{ position:fixed; inset:0; z-index:100; background:#141c2c; }
#helpFrame{ width:100%; height:100%; border:0; display:block; }

#resultTitle{ font-size:48px; color:#ffd93b; text-shadow:3px 3px 0 #b5179e; text-align:center; line-height:1.2; margin:0; }
/* 見出しは2段：あなたの順位（大）＋勝ったチーム（小） */
#resultTitle .rt-rank{ font-size:56px; color:#ffd93b; text-shadow:3px 3px 0 #3a0ca3; }
#resultTitle .rt-sub{ font-size:26px; color:#fff; text-shadow:0 2px 0 rgba(0,0,0,.5); margin-top:4px; }

/* ===== 結果画面（ねこぽいんと計算）と きろく画面の背景：夕やけの草原 =====
   文字（黄色のタイトル・白の数字）が読めるよう、絵そのものの明るさと彩度を落としたうえに暗幕を1枚重ねる。
   position:fixed の擬似要素にしているのは、内容が画面より高くてスクロールしても背景がずれないようにするため。
   画面が隠れている間（.hidden = display:none）は擬似要素ごと消えるので、他の画面には影響しない。 */
#resultScreen, #recordsScreen{ position:relative; }
#resultScreen::before, #recordsScreen::before,
#resultScreen::after,  #recordsScreen::after{ content:''; position:fixed; inset:0; z-index:0; pointer-events:none; }
#resultScreen::before, #recordsScreen::before{
  background:url('assets/bg/sunset.jpg') center/cover no-repeat;
  image-rendering:auto;                  /* body の pixelated を打ち消す（絵は補間して滑らかに出す） */
  filter:brightness(.95) saturate(.85);  /* トーンを落とす：明るさ・彩度を下げる（暗い画面のスマホでも絵が見えるよう .55/.6 から引き上げ） */
}
/* 下ほど濃い暗幕。きろく画面は写真やアルバムが下まで並ぶので同じ濃さで揃える */
#resultScreen::after, #recordsScreen::after{ background:linear-gradient(180deg, rgba(18,10,26,.16), rgba(18,10,26,.38)); }

/* 結果画面の中身は実寸で組み、fitResult()がブラウザ表示サイズに合わせて丸ごと拡大縮小する（等倍上限） */
/* transform-origin:top＝縮小しても上端が動かない。fitResult()が負のマージンで余った高さを詰めるので、
   この2つが揃って初めて「画面に対して正しく中央寄せ」になる（centerだと上に余白が残る） */
/* position:relative + z-index は、上の背景レイヤー(::before/::after)より前面に出すため */
#resultInner{ display:flex; flex-direction:column; align-items:center; gap:18px; width:max-content; transform-origin:top center; position:relative; z-index:1; }
/* 成績表：1チーム＝横1行（順位順に上から）／列は 順位・ボス顔・獲得パワー・バトル勝ち・ボスダメージ・アイテム・撃墜 */
#scoreboard{ }   /* 実寸で描画し、fitResult()が画面サイズに合わせて#resultInnerごと縮小する */
.score-table{ border-collapse:collapse; color:#fff; font-size:20px; background:rgba(18,10,26,.62); border-radius:12px; overflow:hidden; }   /* 明るい背景の上でも見出しが読めるよう濃く */
.score-table th, .score-table td{ padding:4px 7px; text-align:center; white-space:nowrap; border-bottom:1px solid rgba(255,255,255,.12); }   /* 各項目の間隔を従来の1/2（8px 14px→4px 7px） */
.score-table th{ font-size:15px; color:#efe8ff; font-weight:bold; line-height:1.2; }
.score-table tbody tr:last-child td{ border-bottom:none; }
/* 自分の行を強調：柚子色の枠＋「あなた」の札 */
.score-table tr.me td{ background:rgba(255,217,59,.14); border-top:3px solid #ffd93b; border-bottom:3px solid #ffd93b; }
.score-table tr.me td:first-child{ border-left:3px solid #ffd93b; }
.score-table tr.me td:last-child{ border-right:3px solid #ffd93b; }
.sb-you{ display:block; margin:2px auto 0; width:max-content; padding:0 8px; border-radius:999px; background:#ffd93b; color:#241a4d; font-size:16px; font-weight:900; line-height:1.5; }
.score-table .rank{ font-size:26px; font-weight:bold; color:#ffd93b; }
.score-table .sb-boss{ width:121px; height:121px; image-rendering:pixelated; vertical-align:middle; }   /* ボス顔1.5倍（56→84px） */
.score-table td.kills{ vertical-align:middle; white-space:nowrap; }   /* display:flexをやめてセル内で縦中央に揃える（ズレ解消） */
.score-table .kill{ position:relative; display:inline-block; width:84px; height:84px; margin:0 3px; vertical-align:middle; }
.score-table .kill img{ width:84px; height:84px; image-rendering:pixelated; opacity:.85; }   /* 左のボス顔と同じ84px */
/* ✕は線幅を正確に制御するため2本のバーで描画（フォント太さ指定は環境依存のため）。太さ3px＝従来の約1/2 */
.score-table .kill .kx{ position:absolute; inset:0; font-size:0; }
.score-table .kill .kx::before,
.score-table .kill .kx::after{ content:''; position:absolute; left:50%; top:50%; width:78%; height:3px;
  background:#ff2b2b; border-radius:2px; box-shadow:0 0 2px #000; transform:translate(-50%,-50%) rotate(45deg); }
.score-table .kill .kx::after{ transform:translate(-50%,-50%) rotate(-45deg); }

/* ===== にゃんポイント（結果画面のカウントアップ演出） ===== */
#npPanel{ margin:0; text-align:center; }
.np-title{ font-size:28px; font-weight:900; color:#ffd93b; text-shadow:0 2px 0 rgba(0,0,0,.4); }
.np-table{ margin:4px auto 0; border-collapse:collapse; color:#fff; background:rgba(18,10,26,.62); border-radius:12px; overflow:hidden; }
.np-row.zero td{ opacity:.4; }   /* 0 の行はうすく（行の数と位置は変えない） */
.np-table td{ padding:2px 12px; font-size:22px; }
.np-label{ text-align:left; }
.np-calc{ opacity:.7; font-size:16px; }
.np-sub{ text-align:right; font-weight:900; min-width:90px; font-variant-numeric:tabular-nums; }
.np-total{ margin-top:6px; font-size:30px; font-weight:900; color:#fff; display:inline-block; }
.np-total #npTotalVal{ color:#ffd93b; font-variant-numeric:tabular-nums; }
.np-total.pop{ animation:npPop .5s ease-out; }   /* 合計確定時に「ドン」と拡大→戻る */
@keyframes npPop{ 0%{ transform:scale(1); } 30%{ transform:scale(1.35); } 100%{ transform:scale(1); } }
.np-newrecord{ color:#ff5bd0; font-size:30px; font-weight:900; animation:npBlink .5s steps(2) 6; }   /* 3回点滅して止める */
@keyframes npBlink{ to{ opacity:.25; } }
@media (prefers-reduced-motion: reduce){ .np-newrecord{ animation:none; } }   /* 動きを減らす設定の人には点滅させない */
.crown{ display:inline-block; }   /* filterを効かせるためinline-block化（銅・銀・金の絵は icon.js が .c1〜.c3 で選ぶ） */
.np-crown{ font-size:28px; font-weight:900; color:#fff; animation:npIn .4s ease-out both; }   /* both＝delay中は非表示（順次見せ） */
.np-album img{ width:180px; border:6px solid #fff; border-radius:8px;
  box-shadow:0 8px 20px rgba(0,0,0,.45); animation:albumIn .6s ease-out; }
.np-album{ color:#fff; font-size:22px; font-weight:bold; animation:npIn .45s ease-out both; }
@keyframes albumIn{ from{ transform:scale(2) rotate(-8deg); opacity:0; } to{ transform:none; opacity:1; } }
@keyframes npIn{ from{ opacity:0; transform:translateY(12px) scale(.9); } to{ opacity:1; transform:none; } }
/* ボタンは縮める箱（#resultInner）の外にあり、実寸 48px で固定。もう一回＝主役（柚子色）、ほか＝脇役（紫） */
#resultScreen{ gap:8px; }
#resultScreen .result-btns{ position:relative; z-index:1; display:flex; gap:8px; justify-content:center; width:min(100%, 420px); padding:0 16px; box-sizing:border-box; margin-top:4px; }
#resultScreen .result-btns .big-btn{ min-height:48px; padding:0 12px; border-radius:10px; font-size:17px; font-weight:bold; white-space:nowrap;
  background:#3b2d6e; color:#fff; border:2px solid #8f7bd9; box-shadow:0 3px 0 #120a1c; }
#resultScreen .result-btns #retryBtn{ flex:1 1 auto; font-size:20px; background:linear-gradient(180deg,#ffd93b,#f2b705); color:#241a4d; border-color:#b58a00; box-shadow:0 3px 0 #b58a00; }
#resultScreen .result-btns .big-btn:active{ transform:translateY(3px); box-shadow:none; }
#npSkipBtn{ display:none; }   /* カウントアップ演出中のみJSで表示 */
#resultScreen .result-btns.counting{ flex-wrap:wrap; }        /* カウントアップ演出中だけ2段：1段目スキップ、2段目に残り3つ（幅が足りないため） */
#resultScreen .result-btns.counting #npSkipBtn{ display:block; flex:1 0 100%; }   /* JSが display を空に戻すだけでは上の none が残るので、ここで出す */

/* 横長の画面（パソコン・スマホ横）：内訳（左）と成績表（右）を左右に並べ、高さを抑えて縮めすぎない */
@media (orientation: landscape){
  #resultInner{ display:grid; grid-template-columns:auto auto; grid-template-areas:'t t' 'n s'; column-gap:32px; row-gap:14px; align-items:start; justify-items:center; }
  #resultTitle{ grid-area:t; } #npPanel{ grid-area:n; } #scoreboard{ grid-area:s; align-self:center; }
}
/* 高さの低い横長（スマホ横）：ボタンを右の縦一列へ移し、表に高さを回す。細かい列は縦長と同じく隠す（2026-10-31。文字が小さくて読めなかった）
   fitResult() は並びが row のとき、ボタンの高さではなく幅を除いて収める */
@media (orientation: landscape) and (max-height: 500px){
  #resultScreen{ flex-direction:row; gap:16px; }
  #resultInner{ flex-shrink:0; }   /* 横並びで押し縮められると文字が折り返して縦に伸び、fitResult() が豆粒にしていた */
  #resultScreen .result-btns{ flex-direction:column; width:auto; padding:0; margin-top:0; }
  #resultScreen .result-btns .big-btn{ min-height:56px; padding:0 20px; }
  #resultScreen .result-btns #retryBtn{ flex:none; }
  #resultScreen .result-btns.counting #npSkipBtn{ flex:none; }
  .score-table th:nth-child(3), .score-table td:nth-child(3), .score-table th:nth-child(4), .score-table td:nth-child(4),
  .score-table th:nth-child(5), .score-table td:nth-child(5), .score-table th:nth-child(6), .score-table td:nth-child(6){ display:none; }
  .score-table .kill, .score-table .kill img{ width:44px; height:44px; }
  .np-calc{ display:none; }
  .np-album img{ width:100px; border-width:4px; }   /* 内訳の下に縦に積まれて高さを食い、全体が縮んでいた */
}
/* 縦長の画面（スマホ）：成績表を じゅんい・ボス・げきつい・NP の4列に。げきついの顔は小さく。内訳の式の列は隠す */
@media (orientation: portrait){
  .score-table th:nth-child(3), .score-table td:nth-child(3), .score-table th:nth-child(4), .score-table td:nth-child(4),
  .score-table th:nth-child(5), .score-table td:nth-child(5), .score-table th:nth-child(6), .score-table td:nth-child(6){ display:none; }
  .score-table{ font-size:26px; }
  .score-table th{ font-size:22px; padding:6px 12px; }
  .score-table td{ padding:6px 12px; }
  .score-table .kill, .score-table .kill img{ width:44px; height:44px; }
  .np-calc{ display:none; }
  .np-title{ font-size:26px; }
  .np-table td{ font-size:26px; padding:3px 14px; }
  .np-total{ font-size:36px; }
  html[lang="en"] #resultScreen .score-table th{ font-size:20px; }   /* 英語用の小さい指定（下のほう）より優先。4列なので英語でも収まる */
  html[lang="en"] #resultScreen .np-table td{ font-size:24px; }
}

/* ===== 記録画面（ハイスコア・げきつい・アルバム・王冠） ===== */
/* position:relative + z-index は、夕やけ背景のレイヤー(::before/::after)より前面に出すため */
#recordsInner{ text-align:center; max-width:640px; margin:0 auto; padding:12px; position:relative; z-index:1; }
#recordsInner h2{ color:#ffd93b; text-shadow:0 2px 0 rgba(0,0,0,.4); margin:6px 0; }
/* text-shadow は背景（夕やけの絵）の明るい部分に重なったときの読みにくさ対策。上のh2と同じ値 */
.rec-sec h3{ color:#ffd93b; margin:14px 0 6px; font-size:22px; text-shadow:0 2px 0 rgba(0,0,0,.4); }
.rec-hs{ margin:0 auto; border-collapse:collapse; color:#fff; font-size:20px; background:rgba(0,0,0,.25); border-radius:12px; overflow:hidden; }
.rec-hs td{ padding:3px 10px; white-space:nowrap; vertical-align:middle; }
.rec-hs img{ width:70px; height:70px; image-rendering:pixelated; vertical-align:middle; margin:-10px 0; }   /* 顔の絵の上下は透明な余白が多いので、行の高さを詰めて猫と猫の間を約半分に（2026-10-31） */
.rec-hs .np{ font-weight:900; color:#ffd93b; text-align:right; font-variant-numeric:tabular-nums; }
.rec-empty{ opacity:.7; }
.rec-kills{ display:flex; gap:14px; justify-content:center; }
.rec-kill{ position:relative; color:#fff; font-size:20px; }
.rec-kill img{ width:92px; height:92px; image-rendering:pixelated; vertical-align:middle; }
.rec-kill b{ margin-left:2px; }
.rec-kill.sil img{ filter:brightness(0); opacity:.5; }        /* 未撃墜はシルエット */
/* 使えるカード：9種類。まだ使えないカードはシルエット（撃墜コレクションと同じ見せ方） */
.rec-cards{ display:flex; flex-wrap:wrap; gap:6px; justify-content:center; margin:0 auto; }
.rec-cards .rc-break{ flex-basis:100%; height:0; }               /* 最初の4枚と、増えていく5枚の間で改行 */
.rec-card{ display:flex; flex-direction:column; align-items:center; width:74px; color:#fff; }
.rec-card .rc-tile{ display:flex; align-items:center; justify-content:center; width:56px; height:56px; border-radius:10px; background:#fffbe8; }
.rec-card img{ width:44px; height:44px; image-rendering:pixelated; }
.rec-card.big img{ width:56px; height:56px; }                    /* 特大サカナは絵を大きく（サカナと見分ける） */
.rec-card small{ font-size:13px; line-height:1.2; margin-top:3px; text-align:center; text-shadow:0 1px 2px rgba(0,0,0,.8); }
.rec-card.sil .rc-tile{ background:rgba(255,255,255,.25); }      /* まだ使えない：台は薄く、絵はシルエット */
.rec-card.sil img{ filter:brightness(0); opacity:.55; }
.rec-cardnext{ color:#ffd93b; font-size:16px; margin-top:8px; }
/* アルバムは全8枚。4列×2段に固定して上段・下段の枚数を必ず揃える（折り返し任せだと幅次第で5+3等になる） */
.rec-album{ display:grid; grid-template-columns:repeat(4, auto); gap:8px; justify-content:center; }
.rec-photo{ width:120px; height:120px; object-fit:cover; border:4px solid #fff; border-radius:6px; background:#222; }
.rec-photo.none{ display:inline-flex; align-items:center; justify-content:center;
  background:#333; color:#999; font-size:48px; border-color:#666; }
.rec-crowns .crown{ font-size:40px; margin:0 10px; color:#fff; }
.rec-crowns .crown b{ font-size:22px; vertical-align:middle; }
.rec-crowns .crown.none{ filter:grayscale(1) brightness(.4); }
.rec-comp{ color:#ff5bd0; font-size:26px; font-weight:900; margin-top:6px; }
.rec-stats{ color:#fff; opacity:.85; margin-top:14px; font-size:18px; }
/* 保存できないブラウザでの注意書き（storageOk=false のときだけ出る） */
.rec-warn{ background:rgba(224,51,140,.18); border:2px solid #ff5bd0; border-radius:12px;
           color:#fff; font-size:17px; font-weight:700; line-height:1.5; padding:8px 10px; margin:4px 0 10px; }

/* ===== ねこアルバム写真の拡大表示（記録画面／タイトルのきろくスライドから） ===== */
img.rec-photo{ cursor:zoom-in; }   /* 取得済みの写真だけがクリックできる（未取得の「？」はspanなので対象外） */
#photoOverlay{ position:fixed; inset:0; z-index:90;      /* fadeOverlay(50)より前・helpOverlay(100)より後ろ */
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
  padding:16px; background:rgba(0,0,0,.85); cursor:zoom-out; animation:pzFade .2s ease-out; }
#photoZoomImg{ max-width:min(92vw, 720px); max-height:74vh; border:8px solid #fff; border-radius:14px;
  box-shadow:0 12px 34px rgba(0,0,0,.65); animation:pzIn .25s ease-out; }
#photoZoomCap{ color:#ffd93b; font-size:24px; font-weight:900; text-shadow:0 2px 0 rgba(0,0,0,.5); }
.pz-close{ color:#fff; opacity:.75; font-size:16px; font-weight:bold; }
@keyframes pzFade{ from{ opacity:0; } to{ opacity:1; } }
@keyframes pzIn{ from{ transform:scale(.85); opacity:0; } to{ transform:none; opacity:1; } }

/* ===== 製作者情報（タイトルの「製作者情報」ボタンから） ===== */
#creditsOverlay{ position:fixed; inset:0; z-index:95;    /* photoOverlay(90)より前・helpOverlay(100)より後ろ */
  display:flex; align-items:center; justify-content:center;
  padding:16px; background:rgba(0,0,0,.85); animation:pzFade .2s ease-out;
  overflow-y:auto; }                                     /* 低い画面でも中身が全部読めるようにスクロールさせる */
/* ★配色は「UIデザインの基準 虎の巻」（C:\Prog\AI\知財ビジネス\結果\UIデザインの基準_虎の巻_261016.md）に合わせる（2026-10-16）。
   色は意味で3役に絞る：下地＝箱 / 主色＝脇役ボタン / 強調（柚子色）＝主役ボタンと見出しだけ。
   以前は柚子色・黒・赤のリンクとピンクの「とじる」が並び、強調が4つ競っていた（X の黒は箱との差 1.07 で形が溶け、
   「とじる」の白文字とピンクは 3.78 で読みにくかった）。数字はすべて色コードから計算したコントラスト比 */
/* ★2026-10-16 追記：ボタンの色だけ、オフィシャルサイト（yuzuhakanzaki.com の css/style.css）に合わせる。
   画面（箱・見出し・文字）はゲームの紫のまま（サイトのクリーム色にした版は、利用者の判断で戻した）。
   脇役ボタン＝サイトの .button--ghost（サイトと同じく、端末がダークテーマのときは暗いボタン）、
   主役（オフィシャルサイト）＝サイトの「楽曲を聴く」（.button--primary：柚子色のグラデーション・文字 #3a2c00）。
   サイトの薄い枠線（#ece7d9）は形が溶けやすいので、枠線だけは濃くした。数字は紫の箱との差 */
.cr-box{ --c-base:#241a4d; --c-accent:#ffd93b; --c-text:#ffffff; --c-sub:#c9b8ff;   /* 画面：見出し 11.46・名前 15.79・役割ととじる 8.86 */
  --c-ghost:#ffffff; --c-ghost-ink:#2b2a26; --c-ghost-line:#8a8479; --c-ghost-shadow:rgba(0,0,0,.35);   /* 脇役：塗り 15.79・枠線 4.25・文字と塗り 14.36 */
  --c-yuzu-light:#ffd95a; --c-yuzu:#f2b705; --c-yuzu-deep:#b57d00; --c-on-yuzu:#3a2c00;   /* 主役：枠線 4.43・文字と塗り 7.5〜9.95 */
  width:min(92vw, 440px); margin:auto; box-sizing:border-box;
  background:var(--c-base); border:4px solid #7209b7; border-radius:16px;
  box-shadow:0 12px 34px rgba(0,0,0,.65); padding:18px 16px 16px;
  display:flex; flex-direction:column; align-items:center; gap:12px;
  animation:pzIn .25s ease-out; }
@media (prefers-color-scheme: dark){   /* 脇役ボタンだけ、サイトのダークテーマの値（枠線と箱 5.39・文字と塗り 13.67） */
  .cr-box{ --c-ghost:#242320; --c-ghost-ink:#f2efe6; --c-ghost-line:#9d968a; --c-ghost-shadow:rgba(0,0,0,.5); }
}
.cr-title{ margin:0; color:var(--c-accent); font-size:26px; text-shadow:2px 2px 0 #3a0ca3; }
/* 役割（左の列）と名前（右の列）を、それぞれ同じカラムにそろえる。2列のグリッドにして、表全体を箱の中央に置く。
   .cr-row は行のまとまり（HTML の dl の中の div）だが、並べるのはグリッドに任せる（display:contents） */
.cr-list{ margin:0; display:grid; grid-template-columns:auto auto; justify-content:center; align-items:baseline;
  column-gap:8px; row-gap:6px; }
.cr-row{ display:contents; }
.cr-row dt{ color:var(--c-sub); font-size:15px; }
.cr-row dt::after{ content:'：'; }
.cr-row dd{ margin:0; color:var(--c-text); font-size:20px; font-weight:bold; }
.cr-links{ width:100%; display:flex; flex-direction:column; gap:8px; }   /* 余白は 8 の倍数 */
/* リンクは<a>だがボタンに見せる（.big-btnはbutton前提の指定があるので独立させる）。
   既定＝脇役（薄い塗り＋枠線）。X・YouTube はブランド色で塗らず、この形にそろえる（ブランドは文字の前のマークで示す）。
   高さ・角の丸み・影の深さ・文字の大きさは、主役と脇役で同じにする（違いは色だけ） */
.cr-link{ display:flex; align-items:center; justify-content:center; box-sizing:border-box; min-height:48px;   /* 押せる範囲 48 */
  text-align:center; text-decoration:none; font-size:17px; font-weight:bold; padding:12px 16px; border-radius:10px;
  color:var(--c-ghost-ink); background:var(--c-ghost); border:2px solid var(--c-ghost-line); box-shadow:0 4px 0 var(--c-ghost-shadow); }   /* 文字と塗り 14.36（ダーク 13.67） */
.cr-link:active{ transform:translateY(3px); box-shadow:0 1px 0 var(--c-ghost-shadow); }
/* 主役：オフィシャルサイトだけ（1画面に1つ）。サイトの「楽曲を聴く」と同じ柚子色のグラデーション */
.cr-link.site{ background:linear-gradient(135deg, var(--c-yuzu-light), var(--c-yuzu)); color:var(--c-on-yuzu);
  border-color:var(--c-yuzu-deep); box-shadow:0 4px 0 var(--c-yuzu-deep); }
.cr-link.site:active{ box-shadow:0 1px 0 var(--c-yuzu-deep); }
/* 外部サービスの小さなマーク（ブランドは塗りでなくマークで示す）。X のロゴ文字（𝕏）は端末によって豆腐になるので、
   文字ではなく SVG で描く。X＝白い丸に黒い X ロゴ／YouTube＝赤い丸に白い再生の三角 */
.cr-link.x::before, .cr-link.yt::before{ content:''; flex:none; width:24px; height:24px; margin:-2px 8px -2px 0;   /* 上下の -2px：行の高さを押し広げず、主役と同じ高さ（50）にそろえる */
  background:center / contain no-repeat; }
/* X：白いボタン（ライト）では白い丸が溶けるので、黒い丸に白い X。暗いボタン（ダーク）では白い丸に黒い X */
.cr-link.x::before{ background-image: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='12' fill='%23000'/%3E%3Cpath transform='translate(5.5 5.5) scale(.54)' fill='%23fff' d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark){
  .cr-link.x::before{ background-image: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='12' fill='%23fff'/%3E%3Cpath transform='translate(5.5 5.5) scale(.54)' fill='%23000' d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E"); }
}
.cr-link.yt::before{ background-image: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='12' fill='%23ff0000'/%3E%3Cpath fill='%23fff' d='M9.5 7.5v9l7.5-4.5z'/%3E%3C/svg%3E"); }
/* 控え：とじる。文字だけ（下線）。文字と箱 8.86。押せる範囲は 48 を確保 */
.cr-close{ min-height:48px; padding:12px 16px; border:none; background:none; cursor:pointer;
  color:var(--c-sub); font:inherit; font-size:17px; font-weight:bold; text-decoration:underline; text-underline-offset:4px; }
.cr-ai-note{ margin:0; color:var(--c-sub); font-size:13px; line-height:1.6; text-align:center; }   /* 生成AIの注記。脇役なので小さく、役割名と同じ色 */
.cr-link:focus-visible, .cr-close:focus-visible{ outline:3px solid var(--c-accent); outline-offset:2px; }   /* 枠と箱 11.46 */

/* ===== タイトルのカルーセル（遊び方スライド＋きろく） ===== */
#titleCarousel{ position:relative; width:min(94vw, 600px); height:min(58vh, 380px); margin:6px auto 0; }
.tc-slide{ position:absolute; inset:0; opacity:0; transition:opacity .8s; pointer-events:none; text-align:center; overflow-y:auto;
  scrollbar-width:none; -ms-overflow-style:none; }   /* スクロールは可能・スクロールバーは非表示（Firefox/旧Edge） */
.tc-slide::-webkit-scrollbar{ display:none; }   /* Chrome/Safari のスクロールバー非表示 */
.tc-slide.active{ opacity:1; pointer-events:auto; }
.tc-slide p{ color:#fff; font-size:19px; font-weight:bold; margin:8px 0 0; text-shadow:0 2px 0 rgba(0,0,0,.4); }
.tc-board{ position:relative; height:170px; border-radius:10px; overflow:hidden;
  background:repeating-linear-gradient(0deg,#4a7 0 42px,#5b8 42px 84px),
             repeating-linear-gradient(90deg,transparent 0 42px, rgba(0,0,0,.08) 42px 84px); }
/* 移動のゴール位置は「盤の右端からの距離」で指定する。
   固定px（旧: left:420px / 380px）だと、盤が狭いスマホでは猫が盤外まで走って
   ボスを通り過ぎてしまう（PCは盤が広いので露見しなかった）。 */
/* ===== カルーセルのアニメは「表示中だけ・最初から1回」再生する =====
   以前は infinite で表示・非表示に関係なく回り続けていたため、スライド切替（6秒間隔）と
   アニメ周期（5.5秒）がずれ、途中の位相から見え始めて動きが途切れて見えた。
   .active が付いた瞬間に0%から始まり、forwards で終わった状態のまま次のスライドを待つ。 */
.tc-cat{ position:absolute; width:64px; left:8px; top:52px; image-rendering:pixelated; }
.tc-move.active .tc-cat{ animation:tcWalk 5.5s linear forwards; }
@keyframes tcWalk{ 0%,45%{ left:8px; } 100%{ left:calc(100% - 98px); } }   /* 旗が立った後に歩き出す（旗のマスで止まる） */
/* 行き先の目印はプレイ中と同じ赤い旗（2026-10-29：赤い輪から変更）。箱は猫が止まるマス（64px）で、旗はその右上。
   大きさ・位置・ぴょこっと立つ動きはプレイ中の .arrive-flag（マス128pxに旗48×64）を半分にしたもの。アニメ前は消しておく */
.tc-flag{ position:absolute; left:calc(100% - 98px); top:52px; width:64px; height:64px; pointer-events:none; }
.tc-flag svg{ position:absolute; right:1px; top:1px; transform:scale(0); transform-origin:5px 38px;
  filter:drop-shadow(1px 2px 0 rgba(0,0,0,.35)); }
.tc-move.active .tc-flag svg{ animation:tcFlag 5.5s ease-out forwards; }
@keyframes tcFlag{ 0%,20%{ transform:scale(0); } 30%{ transform:scale(1.6); } 40%,100%{ transform:scale(1); } }
/* --- 2枚目：合体 →（パワー加算）→ ボスへ突撃 の一連の流れ（5.5秒ループ） ---
   0〜18% 2匹が寄る／18〜30% 重なって片方が消える＝合体／24〜56% 加算のポップと数字の切替
   42〜72% 合体した猫がボスへ突撃／72〜96% ボスが点滅して倒れる／90〜100% 王冠
   ボスは right:8px・幅90px なので、猫(幅64px)の左端が 100%-162px で接触。少し重ねて当たった感を出す */
@keyframes tcMergeA{        /* 合体して、そのまま突撃する猫 */
  0%       { left:8px; }
  18%      { left:calc(50% - 40px); }
  42%      { left:calc(50% - 40px); }
  72%,100% { left:calc(100% - 150px); }
}
/* 中央で待っている猫。左から来る猫Aと重なって合体し、消える。
   以前は右から中央へ動かしていたが、絵が右向きなのに左へ進むため「バックしている」ように見えた（位置は固定にする） */
@keyframes tcMergeB{
  0%,24%   { opacity:1; }
  30%,100% { opacity:0; }
}
.tc-goal .tc-catB{ left:calc(50% - 40px); }   /* 中央に固定 */
.tc-goal.active .tc-catA{ animation:tcMergeA 5.5s ease-in forwards; }
.tc-goal.active .tc-catB{ animation:tcMergeB 5.5s ease-in forwards; }

/* パワー表示：猫と同じ動き(tcMergeA)で追従させ、合体の瞬間に 10 → 30 へ切り替える */
.tc-pw{ position:absolute; width:64px; top:112px; text-align:center; font-size:15px; font-weight:900;
  color:#ffd93b; -webkit-text-stroke:1px #3a2a10; text-shadow:0 2px 3px rgba(0,0,0,.6); }
.tc-pw2{ opacity:0; }   /* 合体後の数値。アニメ前は隠す */
.tc-goal.active .tc-pw1{ animation:tcMergeA 5.5s ease-in forwards, tcPw1 5.5s linear forwards; }
.tc-goal.active .tc-pw2{ animation:tcMergeA 5.5s ease-in forwards, tcPw2 5.5s linear forwards; }
@keyframes tcPw1{ 0%,24%{ opacity:1; } 28%,100%{ opacity:0; } }
@keyframes tcPw2{ 0%,24%{ opacity:0; } 28%,100%{ opacity:1; } }

/* 「とつげき〜！」：突撃している間だけ、猫の足元に一緒に動く（位置は猫と同じ tcMergeA で追従） */
.tc-go{ position:absolute; width:64px; top:130px; text-align:center; white-space:nowrap;
  font-size:13px; font-weight:900; color:#fff; -webkit-text-stroke:1px #c1440e;
  text-shadow:0 2px 3px rgba(0,0,0,.7); opacity:0;
  }
.tc-goal.active .tc-go{ animation:tcMergeA 5.5s ease-in forwards, tcGo 5.5s linear forwards; }
@keyframes tcGo{ 0%,42%{ opacity:0; } 47%,70%{ opacity:1; } 76%,100%{ opacity:0; } }

/* ★省電力：猫の移動（tcWalk・tcMergeA）は left を動かすため、タイトルを開いているだけで
   毎フレーム レイアウト＋再描画が走っていた（放置で メインスレッド 43ms/秒。止めると 3ms/秒。2026-10-15 実測）。
   盤の幅に対する距離が要るので、盤をコンテナにして cqw（盤の幅の1%）で translate する。
   cqw を使えない古いブラウザは、上の left 版のまま動く。動きの軌跡と時間は同じ */
@supports (width:1cqw){
  .tc-board{ container-type:inline-size; }
  .tc-pw, .tc-go{ left:8px; }                         /* left 版はアニメで 8px から始めていた。translate 版は基準を 8px に置く */
  @keyframes tcWalkT{ 0%,45%{ translate:0 0; } 100%{ translate:calc(100cqw - 106px) 0; } }   /* 8px → 100%-98px */
  @keyframes tcMergeAT{                                /* 8px → 50%-40px → 100%-150px */
    0%       { translate:0 0; }
    18%      { translate:calc(50cqw - 48px) 0; }
    42%      { translate:calc(50cqw - 48px) 0; }
    72%,100% { translate:calc(100cqw - 158px) 0; }
  }
  .tc-move.active .tc-cat{ animation-name:tcWalkT; }
  .tc-goal.active .tc-catA{ animation-name:tcMergeAT; }
  .tc-goal.active .tc-pw1{ animation-name:tcMergeAT, tcPw1; }
  .tc-goal.active .tc-pw2{ animation-name:tcMergeAT, tcPw2; }
  .tc-goal.active .tc-go{ animation-name:tcMergeAT, tcGo; }
}

/* 合体の瞬間の粒子：プレイ中の .pfx.merge と同じ金色の放射。盤が小さいので飛距離だけ縮める */
.tc-pfx{ position:absolute; left:calc(50% - 8px); top:84px; width:14px; height:14px; border-radius:50%;
  background:radial-gradient(#fff,#ffd93b 60%,transparent); filter:blur(.5px); mix-blend-mode:screen;
  pointer-events:none; opacity:0; }
.tc-goal.active .tc-pfx{ animation:tcBurst 5.5s linear forwards; }
@keyframes tcBurst{
  0%,17%   { opacity:0; transform:translate(-50%,-50%) rotate(var(--ang)) translateX(0)    scale(1);  }
  20%      { opacity:1; transform:translate(-50%,-50%) rotate(var(--ang)) translateX(8px)  scale(1);  }
  34%,100% { opacity:0; transform:translate(-50%,-50%) rotate(var(--ang)) translateX(48px) scale(.2); }
}

/* 加算のポップ：合体した位置からふわっと浮いて消える。
   緑の盤面に埋もれないよう、白文字＋濃い縁取りにし、猫の頭より上に出す（緑文字だと同系色で見えなかった） */
.tc-plus{ position:absolute; left:calc(50% - 8px); top:44px; font-size:24px; font-weight:900;
  color:#fff; -webkit-text-stroke:2px #1b6b45; text-shadow:0 2px 6px rgba(0,0,0,.75);
  white-space:nowrap; opacity:0; }
.tc-goal.active .tc-plus{ animation:tcPlus 5.5s ease-out forwards; }
@keyframes tcPlus{
  0%,20%   { opacity:0; transform:translate(-50%, 0) scale(.6); }
  28%      { opacity:1; transform:translate(-50%, -18px) scale(1.15); }
  44%      { opacity:1; transform:translate(-50%, -26px) scale(1); }
  56%,100% { opacity:0; transform:translate(-50%, -34px) scale(1); }
}
/* ボスは突撃が当たったら吹き飛ぶ：プレイ中の撃破演出(bossdefeat)と同じ「回転しながら拡大して消える」動き。
   盤は overflow:hidden なので、拡大してはみ出したぶんは切り取られる（王冠は出さない） */
.tc-boss{ position:absolute; right:8px; top:40px; width:90px; image-rendering:pixelated; }
.tc-goal.active .tc-boss{ animation:tcBlow 5.5s linear forwards; }
@keyframes tcBlow{
  0%,72%   { transform:rotate(0deg) scale(1); filter:none; opacity:1; }
  76%      { transform:rotate(90deg) scale(1.15); filter:brightness(3); opacity:1; }   /* 命中の白フラッシュ */
  100%     { transform:rotate(1440deg) scale(2.6); filter:none; opacity:0; }           /* 4回転しながら拡大して消滅 */
}
/* きろくスライド：フルパネルを縮小せず、フォント/画像を小さめにして自然に収める（読みやすさ優先） */
.tc-records{ font-size:13px; }
.tc-records .rec-sec h3{ font-size:16px; margin:8px 0 4px; }
.tc-records .rec-hs{ font-size:14px; }
.tc-records .rec-hs td{ padding:2px 7px; }
.tc-records .rec-hs img, .tc-records .rec-kill img{ width:34px; height:34px; }
.tc-records .rec-kill{ font-size:15px; }
.tc-records .rec-kills{ gap:10px; }
/* タイトルのスライドは高さが決まっている（#titleCarousel）。カードは名前なしの1行に詰める
   （2行＋名前だと、ちょうどスライドの下端で切れて、下の案内文とかぶって見えた）。くわしくは「きろく」画面で見る */
.tc-records .rec-cards{ flex-wrap:nowrap; gap:4px; }
.tc-records .rec-cards .rc-break{ display:none; }
/* 1枚は最大34px。狭い画面（スマホ縦）では9枚が横幅に収まるよう、縮んでもよい */
.tc-records .rec-card{ flex:0 1 34px; min-width:0; width:auto; }
.tc-records .rec-card .rc-tile{ width:100%; height:auto; aspect-ratio:1; border-radius:8px; }
.tc-records .rec-card img{ width:80%; height:auto; }
.tc-records .rec-card.big img{ width:100%; height:auto; }
.tc-records .rec-card small, .tc-records .rec-cardnext{ display:none; }
/* スライドからはみ出した下の部分（アルバム・王冠）は、下端をぼかして「続きがある」と分かるようにする */
.tc-slide.tc-rec{ -webkit-mask-image:linear-gradient(to bottom, #000 82%, transparent);
  mask-image:linear-gradient(to bottom, #000 82%, transparent); }
.tc-records .rec-album{ gap:6px; }
.tc-records .rec-photo{ width:58px; height:58px; border-width:3px; }
.tc-records .rec-photo.none{ font-size:26px; }
.tc-records .rec-crowns .crown{ font-size:30px; margin:0 8px; }
.tc-records .rec-crowns .crown b{ font-size:16px; }
.tc-records .rec-comp{ font-size:18px; }
.tc-records .rec-stats{ font-size:13px; margin-top:8px; }
.tc-records .rec-warn{ font-size:12px; padding:5px 7px; margin:0 0 6px; border-width:1px; }

/* アイテム紹介スライド：全7種を上段4枚・下段3枚（中央寄せ）に並べる。
   8列の格子に1枚2列ずつ置き、下段の1枚目（5枚目）を2列目から始めて半枚ぶん右へずらす。
   狭い画面でも段が崩れないよう、列幅は可動（minmax）にしてアイテム側を縮める */
.tc-itemboard{ display:grid; grid-template-columns:repeat(8, minmax(0, 1fr)); align-content:center;
  justify-items:center; gap:8px 6px; background:rgba(0,0,0,.28); padding:10px; }
.tc-itemboard .ti{ grid-column:span 2; }
.tc-itemboard .ti:nth-child(5){ grid-column:2 / span 2; }
.tc-itemboard .ti{ width:100%; max-width:82px; display:flex; flex-direction:column; align-items:center; gap:2px; color:#fff; font-size:12px; font-weight:bold; line-height:1.15; }
.tc-itemboard .ti img{ width:44px; height:44px; image-rendering:pixelated; }

/* ===== 手札スタックの枚数バッジ（x2〜x9） ===== */
.card-count{ position:absolute; right:2px; bottom:2px; z-index:3;
  font-size:22px; font-weight:900; color:#fff; -webkit-text-stroke:1px #333;
  text-shadow:0 2px 3px rgba(0,0,0,.5); pointer-events:none; }

/* ===== シールド（盾）カード ===== */
.unit .shield-mark{ position:absolute; right:-8px; bottom:-6px; width:52px; height:52px;
  z-index:2; pointer-events:none; display:none;
  filter:drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.unit.shielded .shield-mark{ display:block; }

/* ===== 👆マーク（まだ行き先を決めていないプレイヤーの猫。猫と一緒に動く） ===== */
.unit .idle-mark{ position:absolute; left:-2px; bottom:4px; font-size:44px; line-height:1;
  z-index:2; pointer-events:none; display:none;
  filter:drop-shadow(0 2px 3px rgba(0,0,0,.5)); animation:idleBob 1s ease-in-out infinite; }
.unit.idle .idle-mark{ display:block; }
@keyframes idleBob{ 0%,100%{ translate:0 0; } 50%{ translate:0 -8px; } }
.clash-cat .shield-up{ position:absolute; bottom:-30px; left:50%; transform:translateX(-50%);
  font-size:24px; font-weight:900; color:#ffd93b; -webkit-text-stroke:1px #634;
  animation:shieldUpIn .3s ease-out; white-space:nowrap; }
@keyframes shieldUpIn{ from{ opacity:0; transform:translateX(-50%) translateY(12px) scale(.9); }
                       to  { opacity:1; transform:translateX(-50%) translateY(0) scale(1); } }

/* ============================================================================
   言語の切り替えボタン（タイトル画面の右上）
   ★自動判定が主役なので、隅に小さく置く。ラベルは ASCII の JA / EN にする ――
     「日本語」と書くと、日本語フォントを持たない英語圏の端末で豆腐になり、
     戻る手段が読めなくなる。
   ========================================================================== */
#titleScreen{ position:relative; }   /* 切り替えボタンを右上に置くための基準 */
.lang-btn{
  position:absolute; top:10px; right:10px; z-index:5;
  display:inline-flex; align-items:center; gap:5px;
  padding:5px 10px; border:1.5px solid #7b6bb0; border-radius:8px;
  background:#2a2440; cursor:pointer;
  font-family:'Segoe UI', sans-serif; font-weight:800; font-size:14px; line-height:1;
  letter-spacing:1px;
}
/* 暗い側は #6f6890（塗りとの差 2.85 で読みにくい）→ #9d93c8（5.22）。明るい側との区別は明るさの差で残る */
.lang-btn .lg-sep{ color:#9d93c8; }
.lang-btn .lg-ja{ color:#ffe89a; }        /* 既定（日本語）は JA を明るく、EN を暗く */
.lang-btn .lg-en{ color:#9d93c8; }
.lang-btn.en .lg-ja{ color:#9d93c8; }     /* 英語のときは入れ替わる */
.lang-btn.en .lg-en{ color:#ffe89a; }
.lang-btn:active{ transform:translateY(1px); }
.lang-btn.hud-lang{ position:static; padding:6px 10px; }   /* 対戦中はポーズ／ヘルプの行に並べる（右上に浮かせない） */
/* 消音ボタン：絵文字だけの正方形。消しているときは暗くして、押してあることが分かるようにする */
button.lang-btn.mute-btn{ justify-content:center; min-width:44px; padding:0; font-size:20px; letter-spacing:0; }
button.lang-btn.mute-btn.muted{ background:#1a1628; border-color:#5a4f86; }

/* ===== タイトル画面（スタート待ち画面）：UIデザインの基準 虎の巻＋背景 B案（2026-10-16） =====
   完成予想図: 結果/スタート待ち画面_背景B_完成予想図_v2_261016.html
   背景は結果画面の夕日と同じ作り（絵＋filter＋暗幕）。トーンは夕日の見え方に合わせて計算した値
   （鮮やかさ 0.465 → 0.194・明るさ 0.423。夕日は 0.189・0.459）。縦方向は余白 8 に詰める */
#titleScreen{ gap:8px; padding:0 16px 8px; box-sizing:border-box; }   /* 左右 16：ボタンが画面の端に接しないように */
#titleScreen::before, #titleScreen::after{ content:''; position:fixed; inset:0; z-index:0; pointer-events:none; }
#titleScreen::before{
  background:url('assets/bg/title.jpg') center/cover no-repeat;
  image-rendering:auto;                                    /* body の pixelated を打ち消す */
  filter:brightness(1.25) saturate(.50) contrast(.80);
}
#titleScreen::after{ background:linear-gradient(180deg, rgba(18,10,26,.16), rgba(18,10,26,.38)); }   /* 夕日と同じ暗幕 */
#titleScreen > *{ position:relative; z-index:1; }          /* 背景（::before／::after）より前に出す */
/* 文字の後ろの帯。背景が明るくなったので、帯が無いと薄紫の文字が溶ける。
   白い雲に重なる最悪でも 説明文 5.55・見出し 7.17・白文字 9.88（文字 4.5 以上） */
#titleScreen .plate{ background:rgba(26,16,36,.80); border-radius:999px; padding:2px 14px; }
.title-top{ align-self:stretch; display:flex; justify-content:flex-end; padding:8px 8px 0; }
.title-top .lang-btn{ position:static; min-height:44px; padding:0 14px; }   /* 押せる高さ 26 → 44 */
.title-top{ gap:8px; }                                     /* 消音ボタンと JA/EN の間 */
#titleScreen .game-title{ margin:-8px 0 0; }               /* 言語ボタンは右端なので、帯とタイトルの間は詰めてよい */
/* タイトルは端末の横幅に合わせた大きさで、必ず1行にする（2026-10-16：iPhone で「ル」だけが2行目に落ちた）。
   「ねこねこロワイヤル」は9文字＝9em。左右の余白 32px・文字の間隔 2px×9・影 8px を引いた幅を 9 で割る。
   iPhone の日本語フォントは1文字がほぼ 1em 幅なので、この式なら収まる。広い画面は 64px で止める */
#titleScreen .game-title{ font-size:clamp(22px, calc((100vw - 64px) / 9), 64px); white-space:nowrap; }
#titleScreen .subtitle, #titleScreen .hint, #titleScreen .ver{ margin:0; }
#titleScreen .hint{ color:#c9b8ff; }                       /* 帯の上なので明るく（帯との差 5.55 以上） */
.title-pick{ margin:0; color:#ffd93b; font-size:20px; font-weight:900; text-align:center; }
/* 札と動く説明の間だけは 16（別のまとまり）。高さは固定せず、ほかを並べた残りを使う（214〜380px）：
   スマホ縦（844）では 1画面に収まり、パソコンなど余裕のある画面では今までどおり 380px まで広がる。
   動く説明のスライドは 214px あれば収まる。「きろく」のスライドは足りない分を中でスクロールする（元からの作り） */
#titleCarousel{ margin:8px auto 0; height:auto; flex:1 1 214px; min-height:214px; max-height:380px; }
#titleScreen .subtitle{ font-size:15px; }                  /* スマホで1行に収める */
#titleScreen .tc-slide p{ display:table; margin:8px auto 0; background:rgba(26,16,36,.80); border-radius:999px; padding:2px 14px; text-shadow:none; }
/* きろく・遊び方・製作者情報：3つとも同じ脇役の形・色・幅（以前はピンク・青・紫で色分けしていた。
   「きろく」の白文字とピンクは 3.78、「製作者情報」の塗りと背景は 2.58 で基準に届かなかった）。押せる高さ 48 */
#titleScreen .title-btns{ display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; width:min(100%, 632px); margin-top:8px; }
#titleScreen .title-btns .big-btn{ min-height:48px; padding:0 8px; font-size:17px; font-weight:bold; white-space:nowrap;
  background:#3b2d6e; color:#fff; border:2px solid #8f7bd9; box-shadow:0 4px 0 #120a1c; }   /* 文字 11.76・枠線と背景 5.25 */
#titleScreen .title-btns .big-btn:active{ box-shadow:0 1px 0 #120a1c; }
#titleScreen .title-btns .big-btn:focus-visible{ outline:3px solid #ffd93b; outline-offset:2px; }
@media (max-width:460px){ #titleScreen .title-btns .big-btn{ font-size:15px; padding:0 4px; } }
@media (max-width:340px){ #titleScreen .title-btns .big-btn{ font-size:13px; } }

/* ============================================================================
   英語で画面が崩れないようにする
   ★日本語の見た目は1pxも変えない。調整はすべて html[lang="en"] の中に閉じる。
     英語は同じ意味でも文字数が増えるので、**切るのではなく折り返す**（切ると意味が消える）。
   ========================================================================== */
/* チーム行のラベル「Calico Cat  CP:120」は日本語より長い。
   以前は nowrap だと右のカード列を押し出すので折り返しを許していたが、2026-10-16 の手札パネル拡大 v5 で
   自分の段はカードを2行目に分けたので押し出さない。折り返すと段が高くなりマップが小さくなる（389→357px）ので、
   折り返さず、1行のままの相手の段だけ文字を1段小さくしてカード列を押し出さないようにする */
html[lang="en"] .team-row .hand-label{ white-space:nowrap; max-width:none; }
html[lang="en"] .team-row:not(.player) .hand-label{ font-size:34px; }
/* にゃんポイントの項目名（Boss takedowns / Rank bonus …）が長いぶん、1段小さくする */
html[lang="en"] .np-table td{ font-size:19px; }
html[lang="en"] .np-calc{ font-size:15px; }
/* 成績表の見出しは2行組み（Power / raised）。英語では1文字ぶん小さくして列幅を保つ */
html[lang="en"] .score-table th{ font-size:13px; }
/* タイトルのアイテム紹介は 82px 幅の枠。英語の単語が長いので1pt下げて収める */
html[lang="en"] .tc-itemboard .ti{ font-size:11px; }
/* きろくの見出し（Takedown Collection）が長い。中央寄せのまま折り返させる */
html[lang="en"] .rec-sec h3{ font-size:20px; }

/* ===== スマホ横向き（タッチの端末の横長画面）：ボタンを縦向きと同じ 44px のまま置く（2026-10-16 v3） =====
   並べ方の数値は JS の fitStageLandscapeTouch が決める（盤面の倍率・右の列の幅・HUD の位置）。パソコンの横長（.is-pc）は従来どおり。
   ★英語用の指定（html[lang="en"] …）より後ろに置くこと（同じ強さの指定は後ろが勝つ） */
/* 2026-10-30：右の列を盤面の 80% の幅にした（JS:LAND_TOUCH_COL_RATIO）。相手3匹は「札」の横並びをやめ、パソコンの横長と同じ3行にする（下の body.landscape の指定） */
.chip-cp{ display:none; }
/* どろぼうを選んでいる間（JS:refreshDim が body.steal-pick）：相手の手札を約36px で出す（名前とメーターは隠して幅を空ける）。ボタンの段は隠す */
body.landscape.steal-pick:not(.is-pc) .team-row:not(.player) .hand-label,
body.landscape.steal-pick:not(.is-pc) .team-row:not(.player) .meters{ display:none; }
body.landscape.steal-pick:not(.is-pc) .team-row:not(.player) .card,
body.landscape.steal-pick:not(.is-pc) .team-row:not(.player) .card .base{ width:154px; height:154px; }
body.landscape.steal-pick:not(.is-pc) .team-row:not(.player) .card .char{ width:118px; height:118px; }
body.landscape.steal-pick:not(.is-pc) #hud .hud-btns > button:not(.hud-lang){ display:none; }
/* ===== 横長（パソコン・スマホとも）：右の列を盤面の 80% の幅にした（JS:PC_COL_RATIO／LAND_TOUCH_COL_RATIO。2026-10-30）ので、手札と相手の名前を少し小さくして収める ===== */
body.landscape .team-row.player{ margin-bottom:var(--enemy-gap, 0px); }   /* 相手の段を自分の段とボタンの間の真ん中へ（値は JS:fitStageLandscape／fitStageLandscapeTouch） */
body.landscape .team-row.player .card, body.landscape .team-row.player .card .base{ width:176px; height:176px; }
body.landscape .team-row.player .card .char{ width:135px; height:135px; }
body.landscape .team-row.player .card .char.char-terrain{ width:91px; height:91px; }
body.landscape .team-row.player .card .char.char-big{ width:227px; height:227px; }
body.landscape .team-row.player .card-count{ font-size:34px; }
body.landscape .team-row:not(.player) .hand-label{ font-size:28px; }   /* 2026-10-31：カード 1.1 倍で、名前の長い三毛ねこ・トラねこの段からカードがはみ出したので 32→28px */
html[lang="en"] body.landscape .team-row:not(.player) .hand-label{ font-size:26px; }   /* 2026-10-31：28→26px（カード 1.1 倍で 5px はみ出した） */
body.landscape .team-row:not(.player) .meters{ width:205px; }   /* 2026-10-31：カード 1.1 倍のぶん 240→205px（名前のいちばん長いチームで収まる幅） */
/* 名前の列の幅を固定し、入りきらない名前（iPhone のヒラギノは文字が広い・👑付き）は名前と CP の間で2行にする。
   列の幅がチームで変わらないので、手札の位置がそろう（2026-10-31：iPhone で三毛ねこの手札だけ右へずれた） */
body.landscape .team-row:not(.player) .team-info{ flex:0 0 205px; width:205px; min-width:0; }
body.landscape .team-row:not(.player) .hand-label{ white-space:normal; line-height:1.15; }
body.landscape .team-row.player .team-cards{ gap:7px; }
body.landscape .team-row:not(.player) .team-cards{ flex:0 0 auto; margin-left:auto; }   /* 箱は中身の幅にして右端へ（伸びる設定だと名前の短い段で箱が広がり、カードが左へずれた。2026-10-31） */   /* 手札は右端にそろえる（名前の長さで左端がずれ、iPhone で手札の位置がバラバラに見えた。2026-10-30） */
body.landscape .team-row:not(.player) .card, body.landscape .team-row:not(.player) .card .base{ width:101px; height:101px; }
body.landscape .team-row:not(.player) .card .char{ width:77px; height:77px; }
body.landscape .team-row:not(.player) .card .char.char-terrain{ width:53px; height:53px; }
body.landscape .team-row:not(.player) .card .char.char-big{ width:131px; height:131px; }
/* ===== スマホ縦向き（JS:fitStage が body.portrait-touch）：マップを画面の横幅ぴったりにするため、チームの段を低くする（2026-10-30） =====
   相手3匹は横向きと同じ「札」で1行に並べる（名前は隠して CP だけ）。自分の段は1行（顔・名前・メーターの右に手札5枚。手札は見た目 約45px）。
   どろぼうの相手を選んでいる間（.steal-pick）は相手の行を元の大きさに戻す（JS が並べ直す） */
body.portrait-touch #teamPanels{ flex-direction:row; flex-wrap:wrap; align-content:flex-start; gap:8px; }   /* 2026-10-31：カード 1.1 倍のぶん 14→8px */
body.portrait-touch .team-row.player{ flex:0 0 100%; box-sizing:border-box; flex-wrap:nowrap; gap:10px; padding:6px 10px; }
body.portrait-touch .team-row.player .team-face{ width:145px; height:145px; margin:-12px; }
body.portrait-touch .team-row.player .hand-label{ font-size:36px; }
body.portrait-touch .team-row.player .meters{ width:248px; }   /* 2026-10-31：カード 1.1 倍のぶん 280→248px */
/* 名前の列の幅を固定（👑が付くと名前が広がり、手札が右で切れた。2026-10-31）。入りきらないときは名前と CP の間で2行にする */
body.portrait-touch .team-row.player .team-info{ flex:0 0 248px; width:248px; min-width:0; }
body.portrait-touch .team-row.player .hand-label{ white-space:normal; line-height:1.15; }
body.portrait-touch .team-row.player .team-cards{ flex:1 1 auto; gap:4px; justify-content:flex-end; }
body.portrait-touch .team-row.player .card, body.portrait-touch .team-row.player .card .base{ width:145px; height:145px; }
body.portrait-touch .team-row.player .card .char{ width:112px; height:112px; }
body.portrait-touch .team-row.player .card .char.char-terrain{ width:76px; height:76px; }
body.portrait-touch .team-row.player .card .char.char-big{ width:187px; height:187px; }
body.portrait-touch .team-row.player .card-count{ font-size:32px; }
body.portrait-touch.steal-pick .team-row:not(.player){ flex:0 0 100%; box-sizing:border-box; }
body.portrait-touch:not(.steal-pick) .team-row:not(.player){ flex:1 1 0; min-width:0; flex-wrap:wrap; row-gap:6px; align-content:flex-start;
  gap:12px; padding:8px 10px; background:rgba(255,255,255,.07); border-radius:14px; justify-content:center; }
body.portrait-touch:not(.steal-pick) .team-row:not(.player) .hand-label{ display:none; }
body.portrait-touch:not(.steal-pick) .chip-cp{ display:block; font-size:44px; font-weight:bold; color:#ffd93b; white-space:nowrap; line-height:1.1; }
body.portrait-touch:not(.steal-pick) .team-row:not(.player) .team-face{ width:145px; height:145px; margin:-12px; }
body.portrait-touch:not(.steal-pick) .team-row:not(.player) .meters{ width:170px; }
body.portrait-touch:not(.steal-pick) .team-row:not(.player) .team-cards{ flex:0 0 100%; display:flex; gap:2px; justify-content:center; }
body.portrait-touch:not(.steal-pick) .team-row:not(.player) .card,
body.portrait-touch:not(.steal-pick) .team-row:not(.player) .card .base{ width:66px; height:66px; }
body.portrait-touch:not(.steal-pick) .team-row:not(.player) .card .char{ width:51px; height:51px; }
body.portrait-touch:not(.steal-pick) .team-row:not(.player) .card .char.char-terrain{ width:34px; height:34px; }
body.portrait-touch:not(.steal-pick) .team-row:not(.player) .card .char.char-big{ width:85px; height:85px; }
body.portrait-touch:not(.steal-pick) .team-row:not(.player) .card-count{ font-size:24px; }
/* ボタンの段（HUD）：右の列の下。上＝案内文（2行に固定）、下＝ポーズ・ヘルプ・決着の横並び（2026-10-30 に右の列を細くしたので縦並びから変更） */
body.landscape:not(.is-pc) #hud{ display:flex; flex-direction:column; align-items:stretch; gap:6px; padding:0 4px; box-sizing:border-box; }
body.landscape:not(.is-pc) #statusMsg{ font-size:13px; line-height:1.3; height:2.6em; text-align:left;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }   /* 2行に固定（長さで段の高さが変わると盤面が伸び縮みする） */
body.landscape:not(.is-pc) .hud-btns{ display:flex; flex-direction:row; gap:6px; width:100%; }
body.landscape:not(.is-pc) .hud-btns #pauseBtn, body.landscape:not(.is-pc) .hud-btns #helpBtn, body.landscape:not(.is-pc) .hud-btns #skipBtn{
  flex:1 1 0; min-width:0; padding:0 2px; font-size:13px; white-space:nowrap; overflow:hidden; }   /* ID で付いている大きさ（.hud-btns #pauseBtn 等）より強くする */
body.landscape:not(.is-pc) #statusMsg{ padding-right:44px; }   /* 右端に消音ボタン（下の #playMuteBtn）を置くので、文字を重ねない */
/* 消音ボタンは案内文の右端（top・right は JS が #hud からの相対位置で書く）。fixed にすると iPhone のノッチの余白ぶん枠の外へはみ出す */
body.landscape:not(.is-pc) #playMuteBtn{ position:absolute; z-index:5; width:38px; min-width:38px; height:34px; min-height:34px; padding:0; }   /* 右の列の右上（right と top は JS が書く。対戦中の JA/EN は 2026-10-29 に外した） */

/* ===== スタート前画面の改善（2026-10-16 スタート前画面改善プラン） =====
   説明の帯（.hint）は廃止（1枚目のスライドと同じ内容）。英語用の指定より後ろに置く */
/* 4つの札を同じ幅に（いちばん長い名前に合わせる。max-content の箱の中の 1fr はいちばん広い列にそろう） */
.title-start{ grid-template-columns:repeat(4, 1fr); }
@media (max-width:620px){ .title-start{ grid-template-columns:repeat(2, 1fr); } }
/* 副題とスライドの文は、言葉の途中で折らない（区切りの空白でだけ折る）。狭い画面は副題を 13px にして1行に */
#titleScreen .subtitle, #titleScreen .tc-slide p{ word-break:keep-all; }
@media (max-width:380px){ #titleScreen .subtitle{ font-size:13px; } }
/* 背の低い画面（高さ 700px 未満。iPhone SE・Safari のアドレスバーあり）：きろく・遊び方・製作者情報を画面の中に入れる。
   札の猫の絵 80→60px（札 111→91px）、スライド 214→186px。盤は 170→134px にし、中の絵（高さ 170 の位置で作ってある）をまとめて 10px 上へ */
@media (max-height:700px){
  .start-cat img{ width:78px; height:78px; margin:-9px 0; }   /* 2026-10-31 に 60→78px（1.3倍）。増えた18pxを上下で詰める */
  #titleCarousel{ flex-basis:186px; min-height:186px; }
  #titleScreen .tc-board{ height:134px; }
  #titleScreen .tc-cat{ top:42px; } #titleScreen .tc-flag{ top:42px; } #titleScreen .tc-pw{ top:102px; } #titleScreen .tc-go{ top:120px; }
  #titleScreen .tc-pfx{ top:74px; } #titleScreen .tc-plus{ top:34px; } #titleScreen .tc-boss{ top:30px; }
  #titleScreen .tc-slide p{ font-size:16px; margin-top:6px; }
  #titleScreen .tc-itemboard .ti img, #titleScreen .tc-itemboard .ti-svg{ width:32px; height:32px; }
}
/* サムネイルの「タップで スタート」：1秒後に出て、ゆっくり明るさを変える（動きを減らす設定では変えない） */
#splashScreen{ position:relative; }
.splash-tap{ position:absolute; left:50%; bottom:max(24px, 6vh); transform:translateX(-50%); margin:0; padding:6px 18px; border-radius:999px;
  background:rgba(26,16,36,.80); color:#fff; font-size:16px; font-weight:bold; white-space:nowrap; opacity:0; pointer-events:none; }
#splashScreen.run .splash-tap{ animation:splashTapIn .6s ease-out 1s forwards, splashTapPulse 1.6s ease-in-out 1.6s infinite; }
@keyframes splashTapIn{ to{ opacity:1; } }
@keyframes splashTapPulse{ 0%,100%{ opacity:1; } 50%{ opacity:.55; } }
@media (prefers-reduced-motion: reduce){ #splashScreen.run .splash-tap{ animation:splashTapIn .6s ease-out 1s forwards; } }

/* ===== 「きろく」画面の改善（2026-10-16 きろく画面改善プラン）。#recordsPanel の中だけ（タイトルの「きろく」スライドには効かせない） ===== */
/* 中身を画面の幅に収める（以前はアルバム 120px×4列が幅 528px を決め、スマホで右が約 140px 切れていた） */
#recordsInner{ box-sizing:border-box; width:100%; max-width:640px; padding:12px 12px 24px; }
#recordsPanel .rec-album{ grid-template-columns:repeat(4, minmax(0, 120px)); }
#recordsPanel .rec-photo{ width:100%; height:auto; aspect-ratio:1; box-sizing:border-box; }
#recordsPanel .rec-photo.none{ display:flex; }
#recordsPanel .rec-kills{ flex-wrap:wrap; gap:10px 14px; }
@media (max-width:480px){
  #recordsPanel .rec-card{ width:62px; }
  #recordsPanel .rec-card .rc-tile{ width:52px; height:52px; }
  #recordsPanel .rec-card img{ width:40px; height:40px; }
  #recordsPanel .rec-card small{ font-size:11px; white-space:nowrap; letter-spacing:-.3px; }   /* 名前は1行（どろぼうねこ／地形へんこう が途中で折れていた） */
  #recordsPanel .rec-kill img{ width:74px; height:74px; }
  #recordsPanel .rec-hs{ font-size:17px; }
  #recordsPanel .rec-hs td{ padding:3px 6px; }
  #recordsPanel .rec-hs img{ width:58px; height:58px; margin:-8px 0; }
}
@media (max-width:380px){
  #recordsPanel .rec-cards{ gap:6px 4px; }
  #recordsPanel .rec-card{ width:60px; }
  #recordsPanel .rec-card small{ font-size:10.5px; }
  #recordsPanel .rec-kills{ gap:8px; }
  #recordsPanel .rec-kill img{ width:64px; height:64px; }
  #recordsPanel .rec-kill{ font-size:17px; }
}
/* まとまりごとに半透明の黒い箱（明るい夕やけの上でも見出し・小さな文字が読める。結果画面の表と同じ濃さ） */
#recordsPanel .rec-sec{ background:rgba(18,10,26,.62); border-radius:14px; padding:4px 10px 12px; margin:10px 0 0; }
#recordsPanel .rec-sec h3{ margin:8px 0 6px; }
#recordsPanel .rec-hs{ background:transparent; }
#recordsPanel .rec-stats{ display:inline-block; background:rgba(18,10,26,.62); border-radius:999px; padding:2px 14px; opacity:1; }
/* まだのカードの台は暗く（白 25% → 10%）。使えるようになった どろぼうねこ（もともと黒い絵）は台の明るさで見分け、白い縁取りも付ける */
#recordsPanel .rec-card.sil .rc-tile{ background:rgba(255,255,255,.10); }
#recordsPanel .rec-card:not(.sil) img.dark{ filter:drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }
/* 「← もどる」：遊び方（howto.html の .back-btn）と同じ見た目（2026-10-29 に きろく画面の上下のボタンをそろえた）。
   色・角・影を変えるときは howto.html の .back-btn も一緒に直す */
.back-btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:44px;
  font:inherit; font-weight:700; font-size:16px; color:#fff;
  background:linear-gradient(180deg,#ff8a4c,#ff6b3d);
  border:none; border-radius:12px; padding:10px 18px; cursor:pointer;
  box-shadow:0 4px 0 #c14a22; }
.back-btn:active{ transform:translateY(3px); box-shadow:0 1px 0 #c14a22; }
#recBackTopBtn{ position:absolute; left:12px; top:10px; }   /* 上の「← もどる」は左上に置く */
#recBackBtn{ margin-top:16px; }                            /* 下の「← もどる」は通算の行とくっつかないように離す */
#recordsInner > h2{ margin:10px 0 6px; line-height:44px; }
/* ハイスコアの数字に NP（タイトルの「きろく」スライドも同じ） */
.rec-hs .np small{ font-size:.6em; margin-left:3px; color:#efe8ff; font-weight:bold; }
