/* fit.css（2026-11-21）：画面の大きさ・文字サイズに合わせた直し（tools/check/ui_check.py の点検から）
   ほかの CSS より後に読む（ext.css を除く）。同じ指定を上書きするときは、ここに理由を書く */

/* ---------- 問題箱 #5：ホームの吹き出し ----------
   これまでは吹き出しを px（top: 122px など）で置いていたため、文字「大」や背の低い画面で
   日付・おすすめと重なり、セリフが切れていた。
   → 相棒の欄（.pa-home）を「日付とおすすめの間の残りの高さ」にして、吹き出しはその中の流れに置く。
     日付の下から始まり、おすすめより下には出ない。中身が多いときはホームが少し伸びる（重ならない）。
   相棒の絵（.pa-fig）は今までどおり .home を基準に置く（.pa-home は position: static のまま） */
.home .pa-home { flex: 1 0 auto; display: flex; flex-direction: column; align-items: flex-start; min-height: 0; }
.home .pa-home .pa-bub,
.home .pa-home.pa-bust .pa-bub,
.home .pa-home:not(.pa-bust) .pa-bub {
  position: relative; top: auto; bottom: auto; left: auto; align-self: flex-start; flex: 0 0 auto;
  margin: 10px 0 14px 2px;
  width: 50%; max-width: 15.5em;
}
/* しっぽは吹き出しの右下から相棒の顔へ */
.home .pa-home .pa-bub::after { top: auto; bottom: 18px; }
.home .pa-home .pa-say { overflow-wrap: anywhere; }
/* 好感度の1行は折り返してよい（切らない） */
.home .pa-home .pa-bond { display: block; line-height: 1.45; }

/* 背の低い画面（高さ 720px 未満）：吹き出しの文字を少し小さく、余白を詰める */
@media (max-height: 720px) {
  .home .pa-home .pa-bub { margin-top: 8px; margin-bottom: 10px; padding: 8px 10px; }
  .home .pa-home .pa-say { font-size: .86rem; line-height: 1.55; }
  .home .pa-home .pa-read { margin-top: 6px; }
}
/* 文字「大」：吹き出しの幅は顔にかからない 54% まで。文字は少しだけ小さく */
html[data-font=l] .home .pa-home .pa-bub { width: 54%; max-width: none; }
html[data-font=l] .home .pa-home .pa-say { font-size: .86rem; line-height: 1.5; }
html[data-font=l] .home .pa-home .pa-bond { font-size: .6rem; }
@media (max-height: 720px) {
  html[data-font=l] .home .pa-home .pa-say { font-size: .8rem; line-height: 1.45; }
  html[data-font=l] .home .pa-home .pa-read b { font-size: .72rem; }
}

/* ホームの上の段（ランク・連続日数・ボタン）：幅の狭い画面や文字「大」で「PLAYER RANK」が切れ、
   「0 / 100 XP」が2行になって段が高くなっていた → 字間を詰めて1行に収める */
.home .rank > div { overflow: visible; }
.home .rank small { letter-spacing: .5px; font-size: .6rem; overflow: visible; }
.home .rank em { white-space: nowrap; font-size: .62rem; }
.home .rank > b { padding: 4px 10px; font-size: 1.6rem; }
/* 連続日数の数字と「日連続」の間をあける（数字の字形が「日連続」にかかっていた） */
.home .streak b { margin-right: 4px; }
/* おすすめ：文字「大」でも1行に（左の英字の欄を詰める） */
html[data-font=l] .home > .rec small { min-width: 0; }
html[data-font=l] .home .rank small { letter-spacing: 0; font-size: .56rem; }
html[data-font=l] .home .rank em { font-size: .56rem; }
html[data-font=l] .home > .rec b { font-size: .92rem; }

/* ---------- 問題箱 #6：単語の一覧のタイル ----------
   番号の横に英単語2語を1行で置いていたため、文字「大」では「be・ha…」と切れていた
   （点検では、幅の狭い画面なら文字「中」「小」でも切れていた）。
   → 「番号＋点」の行と「英単語」の行に分け、英単語はタイルの幅いっぱいに。長いときは語の切れ目で2行まで折り返す */
.lx-tile { grid-template-columns: auto 1fr; grid-template-rows: auto auto; grid-template-areas: "no dots" "w w"; row-gap: 5px; }
.lx-tile .lx-no { grid-area: no; grid-row: auto; font-size: 1.8rem; }
.lx-tile .lx-dots { grid-area: dots; align-self: center; }
.lx-tile .lx-w { grid-area: w; white-space: normal; overflow: visible; text-overflow: clip; font-size: .86rem; line-height: 1.3; overflow-wrap: break-word; }
html[data-font=l] .lx-tile .lx-no { font-size: 1.6rem; }
html[data-font=l] .lx-tile .lx-w { font-size: .82rem; }
