/* FPS才能診断（/fps/・2026-10-24・設計は docs/fps/brief.md）
   ふだんの画面はナカミドの見た目のまま（白と黒・数字が主役）。ゲームの画面（.fps-screen）だけ暗い「ゲームの画面」の枠
   色: 夜の紺 --fps（共有の画像の地・科目の印）・照準の緑 --fps-acc（ゲームの画面の中だけ）・判子の朱 --fps-red（通知表の総合の評価） */
:root {
  --fps: #1f2f4f;
  --fps-deep: #121b2e;
  --fps-acc: #5cf08a;
  --fps-red: #d23c4f;
  --fps-paper: #fffcf4;
  --fps-rule: #e6dfcd;
}

/* ─── 入口・ハブ ─── */
.fps-intro { display: grid; gap: 14px; padding: 22px 0 6px; }
.fps-intro h1 { font-size: clamp(28px, 8vw, 36px); letter-spacing: .01em; }
.fps-h1-sub { display: inline-block; font-size: .72em; margin-left: .1em; }
.fps-hero { position: relative; border-radius: 22px; overflow: hidden; background: var(--fps-deep); color: #fff; box-shadow: 0 18px 40px -26px rgba(18, 27, 46, .8); }
.fps-hero-art { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.fps-hero-text { position: absolute; right: 14px; top: 14px; display: grid; gap: 4px; justify-items: end; text-align: right; max-width: 52%; }
.fps-hero-text b { font: 800 clamp(15px, 4.6vw, 21px)/1.35 var(--f-round); text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.fps-hero-text span { font-size: clamp(11px, 3.1vw, 13px); font-weight: 700; color: var(--fps-acc); letter-spacing: .04em; word-break: auto-phrase; }
/* 背の低いスマホ（320×568 など）: 絵を横長に切って間を詰め、「通しで遊ぶ」「はじめる」を1画面目に入れる（tools/test/fps-flow.mjs の G） */
@media (max-height: 640px) and (max-width: 600px) {
  .fps-intro { gap: 10px; padding-top: 14px; }
  .fps-hero-art { aspect-ratio: 16 / 7; }
}
.fps-prog-box { display: grid; gap: 6px; }
.fps-prog { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.fps-seg { display: block; height: 10px; border-radius: 5px; background: #e2e2dc; }
.fps-seg.on { background: var(--fps); }
.fps-prog-text { font-size: 14px; font-weight: 700; color: var(--ink2); }
.fps-links { display: flex; flex-wrap: wrap; gap: 0 18px; }
.fps-subjs { display: grid; gap: 10px; }
.fps-subj { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 68px; padding: 12px 12px 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); }
a.fps-subj:hover { border-color: #c9c9c2; }
.fps-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--fps); color: var(--fps-acc); flex: none; }
.fps-ic svg { width: 26px; height: 26px; display: block; }
.fps-subj-no { position: absolute; left: 8px; top: 8px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #fff; border: 1.5px solid var(--fps); color: var(--fps); font: 800 11px/15px var(--f-round); text-align: center; }
.fps-subj-body { display: grid; gap: 2px; min-width: 0; }
.fps-subj-body b { font: 700 16px/1.35 var(--f-round); }
.fps-subj-body b small { font-size: 13px; font-weight: 700; color: var(--ink2); margin-left: 2px; display: inline-block; }
.fps-subj-lead { font-size: 12.5px; line-height: 1.55; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: auto-phrase; }
.fps-subj-st { display: grid; justify-items: end; gap: 0; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; text-align: right; }
.fps-subj-st b { font: 800 17px/1.2 var(--f-round); color: var(--ink); font-variant-numeric: tabular-nums; }
.fps-subj-st small { font-size: 11px; color: var(--muted); }
.fps-subj.done { border-color: var(--fps); box-shadow: inset 0 0 0 1px var(--fps); }
.fps-subj.soon { background: #f3f3ef; color: var(--ink2); }
.fps-subj.soon .fps-ic { background: #8a90a0; color: #e8eaf0; }
.fps-subj.soon .fps-subj-st { color: #7a7f8a; }
@media (max-width: 359px) {
  .fps-subj { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
  .fps-ic { width: 40px; height: 40px; }
  .fps-subj-lead { display: none; }
}

/* ─── 科目のページの説明 ─── */
.fps-game-intro { gap: 12px; }
.fps-preview svg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 18px; box-shadow: 0 16px 34px -24px rgba(18, 27, 46, .8); }
@media (max-height: 640px) and (max-width: 600px) { .fps-preview svg { aspect-ratio: 16 / 7; } }
.fps-h2 { font-size: 18px; margin-top: 8px; }
.fps-howto { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; font-size: 15px; line-height: 1.7; }
/* 前の版の記録（2026-10-26・版を上げる前の記録・共有のリンク）: 札と断り */
.fps-pill.old { display: inline-block; min-height: 0; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #fff3d1; color: #6b4a00; font: 700 11px/1.6 var(--f-round); font-style: normal; white-space: nowrap; vertical-align: middle; }
.fps-rp-table tr.old td { color: var(--muted); }
.fps-rc-old { margin: 4px 0 0; padding: 6px 10px; border-radius: 10px; background: rgba(255, 209, 102, .16); color: #ffe3a3; font: 700 13px/1.55 var(--f-round); word-break: auto-phrase; }
.fps-old-note { word-break: auto-phrase; }
/* 遊び方の下の絵の見本（見分け撃ちの 敵・味方・灰色の敵・灰色の味方・2026-10-26）。幅320でも4つが1列に並ぶ */
.fps-howto-art { margin: 4px 0 0; padding: 12px 10px 10px; border-radius: 16px; background: #121b2e; color: #e8ecf5; }
.fps-howto-art ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fps-howto-art li { display: grid; justify-items: center; align-content: start; gap: 2px; text-align: center; }
.fps-howto-art svg { width: 100%; max-width: 64px; height: 64px; }
.fps-howto-art b { font: 700 13px/1.35 var(--f-round); }
.fps-howto-art small { font-size: 11.5px; line-height: 1.45; color: #aab3c5; word-break: auto-phrase; }
.fps-howto-art figcaption { margin-top: 8px; font-size: 13px; line-height: 1.6; color: #d7dceb; word-break: auto-phrase; }
.fps-runbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 2px 8px 2px 12px; border-radius: 12px; background: var(--fps); color: #fff; font-size: 14px; }
.fps-runbar b { font: 700 14px/1.4 var(--f-round); }
.fps-runbar .linklike { color: #d8def0; font-size: 13px; min-height: 44px; padding: 0 4px; }
.fps-play { min-height: 60vh; }

/* ─── 1科目の結果 ─── */
.fps-vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fps-result { display: grid; gap: 12px; padding-top: 18px; }
.fps-rcard { text-align: left; justify-self: stretch; display: grid; gap: 6px; padding: 18px 18px 16px; border-radius: 22px; color: #fff; background: radial-gradient(120% 90% at 100% 0%, #2c4370 0%, var(--fps) 46%, var(--fps-deep) 100%); box-shadow: 0 18px 40px -26px rgba(18, 27, 46, .9); }
.fps-rc-top { display: flex; justify-content: space-between; gap: 10px; font: 800 12px/1.4 var(--f-round); letter-spacing: .12em; color: rgba(255, 255, 255, .78); }
.fps-rc-top span:last-child { letter-spacing: .02em; }
.fps-rc-sub { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 16px; }
.fps-rc-sub .fps-ic { width: 36px; height: 36px; border-radius: 11px; background: rgba(255, 255, 255, .1); }
.fps-rc-sub .fps-ic svg { width: 22px; height: 22px; }
.fps-rc-sub b { font: 800 19px/1.3 var(--f-round); }
.fps-rc-sub span { font-weight: 700; color: rgba(255, 255, 255, .82); }
.fps-rc-eb { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .75); }
.fps-rc-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.fps-rc-num { font: 800 clamp(76px, 25vw, 112px)/1 var(--f-round); letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 0; }
.fps-rc-num.three { font-size: clamp(62px, 19.5vw, 100px); } /* 100点（幅320〜390でも「点」が次の行に落ちない・tools/test/fps-flow.mjs の G） */
.fps-rc-num small { font-size: .26em; letter-spacing: 0; margin-left: .15em; font-weight: 700; }
.fps-rc-lv { display: grid; justify-items: center; gap: 2px; min-width: 96px; padding: 10px 10px 8px; border: 2.5px solid var(--fps-acc); border-radius: 16px; color: var(--fps-acc); margin-bottom: 6px; }
.fps-rc-lv span { font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.fps-rc-lv b { font: 800 46px/1 var(--f-round); }
.fps-rc-lv small { font-size: 10.5px; font-weight: 700; text-align: center; line-height: 1.35; word-break: auto-phrase; max-width: 8em; }
.fps-rc-name { font: 800 clamp(20px, 6vw, 24px)/1.35 var(--f-round); }
.fps-rc-raw, .fps-rc-cmp { font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, .88); }
.fps-rc-raw { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.fps-rc-raw b { font: 800 17px/1.5 var(--f-round); color: #fff; font-variant-numeric: tabular-nums; }
.fps-rc-raw span { font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.fps-rc-cmp { font-weight: 700; color: #fff; }
.fps-rc-dev { font-size: 12px; font-weight: 700; color: var(--fps-acc); letter-spacing: .04em; }
.fps-point-note { font-size: 13px; color: var(--muted); }
.fps-next { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.fps-next h2 { font-size: 18px; }
.fps-left { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fps-left li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14.5px; font-weight: 700; }
.fps-left .fps-ic { width: 32px; height: 32px; border-radius: 10px; }
.fps-left .fps-ic svg { width: 20px; height: 20px; }
.fps-left small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.fps-fail { display: grid; gap: 14px; padding: 36px 0 12px; text-align: center; justify-items: center; }
.fps-run-all { display: block; min-height: 44px; margin: 2px auto 0; text-align: center; }
/* 記録なしの画面の「とばして次へ（次の科目）」: 朱のボタンと同じく、主の文とかっこの部分のあいだでだけ割れる */
.fps-skip .go-main { display: inline-block; }
.fps-skip .go-sub { display: inline-block; font-size: .8em; margin-left: .4em; }
.fps-run-all[hidden] { display: none; } /* クラスの display に hidden が負けないように */
.fps-fail h1 { font-size: 26px; }
.fps-fail p { color: var(--ink2); max-width: 24em; }

/* ─── 通知表 ─── */
.fps-report { display: grid; gap: 14px; padding: 18px 16px 16px; border-radius: 20px; background: var(--fps-paper); border: 2px solid var(--fps); box-shadow: inset 0 0 0 5px var(--fps-paper), inset 0 0 0 6px rgba(31, 47, 79, .35), 0 16px 34px -26px rgba(18, 27, 46, .6); }
.fps-rp-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 2px 10px; padding-bottom: 8px; border-bottom: 3px double var(--fps); }
.fps-rp-site { grid-column: 1 / -1; font: 800 11px/1.4 var(--f-round); letter-spacing: .1em; color: var(--muted); }
.fps-rp-head h2 { font-size: 28px; letter-spacing: .2em; }
.fps-rp-dev { font-size: 12.5px; font-weight: 700; color: var(--ink2); text-align: right; }
.fps-rp-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fps-rp-table thead th { font-size: 12px; font-weight: 700; color: var(--muted); text-align: left; padding: 0 4px 6px; }
.fps-rp-table thead th:nth-child(2) { text-align: center; width: 64px; }
.fps-rp-table thead th:nth-child(3) { text-align: right; width: 64px; }
.fps-rp-table tbody tr { border-top: 1px solid var(--fps-rule); }
.fps-rp-table tbody th { display: flex; align-items: center; gap: 10px; padding: 8px 4px; text-align: left; font-weight: 400; }
.fps-rp-table tbody th .fps-ic { width: 34px; height: 34px; border-radius: 10px; }
.fps-rp-table tbody th .fps-ic svg { width: 21px; height: 21px; }
.fps-rp-table tbody th span { display: grid; min-width: 0; }
.fps-rp-table tbody th b { font: 700 15.5px/1.3 var(--f-round); }
.fps-rp-table tbody th small { font-size: 12px; color: var(--muted); }
.fps-rp-table td.lv { text-align: center; }
.fps-rp-table td.lv b { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--ink); border-radius: 8px; font: 800 24px/1 var(--f-round); }
.fps-rp-table td.pt { text-align: right; font: 800 20px/1 var(--f-round); padding-right: 4px; white-space: nowrap; }
.fps-rp-table td.pt small { font-size: 11px; font-weight: 700; margin-left: 2px; }
.fps-rp-table td.none { text-align: right; padding-right: 4px; }
.fps-rp-table tfoot tr { border-top: 2.5px solid var(--ink); }
.fps-rp-table tfoot th { text-align: left; padding: 10px 4px 0; font: 700 15px/1.3 var(--f-round); }
.fps-rp-table tfoot td { text-align: right; padding: 10px 4px 0; font: 800 26px/1 var(--f-round); white-space: nowrap; }
.fps-rp-table tfoot td small { font-size: 12px; font-weight: 700; color: var(--ink2); }
.fps-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: #efede6; color: var(--ink2); font-size: 12.5px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.fps-pill.soon { background: #e7e7e2; color: #7a7f8a; }
.fps-pill.go { background: var(--fps); color: #fff; min-height: 44px; padding: 0 14px; }
.fps-rp-sum { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; align-items: center; }
.fps-rp-grade { display: grid; justify-items: center; gap: 2px; text-align: center; color: var(--fps-red); }
.fps-rp-grade span, .fps-rp-role span { font-size: 12px; font-weight: 700; color: var(--muted); }
.fps-rp-grade b { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; border: 4px solid var(--fps-red); box-shadow: inset 0 0 0 3px var(--fps-paper), inset 0 0 0 4.5px var(--fps-red); font: 800 44px/1 var(--f-round); transform: rotate(-8deg); }
.fps-rp-grade small { font-size: 12.5px; font-weight: 800; word-break: auto-phrase; }
.fps-rp-role { display: grid; gap: 2px; }
.fps-rp-role b { font: 800 clamp(21px, 6.4vw, 26px)/1.3 var(--f-round); }
.fps-rp-role p { font-size: 13.5px; line-height: 1.65; color: var(--ink2); }
.fps-rp-sum.locked .fps-rp-grade { color: #9a9fa8; }
.fps-rp-sum.locked .fps-rp-grade b { border-color: #c4c6cc; box-shadow: none; transform: none; color: #9a9fa8; }
.fps-rp-sum.locked .fps-rp-role b { color: #9a9fa8; }
.fps-rp-comment { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: #f5efdd; }
.fps-rp-comment span { font-size: 12.5px; font-weight: 800; color: var(--fps); }
/* 罫線は文の行の下（行の高さ 28px ごとに、行の下はしに1本）。箱の上から引くと、文の真ん中を通っていた */
.fps-rp-comment p { font-size: 14.5px; line-height: 28px; background-image: repeating-linear-gradient(transparent 0 27px, rgba(31, 47, 79, .14) 27px 28px); }
.fps-switch { margin-top: 12px; }
.fps-friend-sum { background: var(--fps-paper); border: 2px solid var(--fps); border-radius: 20px; padding: 16px; }
.fps-cta { --c-seishin-t: #e7ecf6; }
.fps-friend-note { margin: 2px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); word-break: auto-phrase; } /* 友達に送るページの「確かめたものではありません」（カードのすぐ下に小さく・2026-10-26） */
.fps-badlink { display: grid; gap: 8px; padding: 18px; border-radius: 18px; background: #f3f1ea; color: var(--ink); font-size: 15px; line-height: 1.7; word-break: auto-phrase; }
.fps-badlink .how-link { justify-self: start; min-height: 44px; display: inline-flex; align-items: center; }
@media (max-width: 359px) {
  .fps-report { padding: 16px 12px 14px; }
  .fps-rp-sum { grid-template-columns: 96px minmax(0, 1fr); }
  .fps-rp-grade b { width: 72px; height: 72px; font-size: 38px; }
  .fps-rp-table tbody th .fps-ic { display: none; }
}

/* ─── ゲームの画面（全画面・shell.js）─── */
.fps-screen { position: fixed; inset: 0; z-index: 2147483000; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); background: #0b0f16; color: #fff;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; overscroll-behavior: none; }
.fps-hud { display: flex; align-items: center; gap: 12px; height: calc(48px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); background: #080b11; border-bottom: 1px solid #1a2332; font: 700 14px/1.2 var(--f-round); }
.fps-hud-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; }
.fps-hud-name b { color: var(--fps-acc); }
.fps-hud-name span { color: #aab3c5; overflow: hidden; text-overflow: ellipsis; }
.fps-hud-prog { margin-left: auto; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fps-quit { flex: none; min-height: 44px; min-width: 76px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .4); background: transparent; color: #fff; font: 700 14px/1 var(--f-round); cursor: pointer; }
.fps-arena { position: relative; display: grid; place-items: center; padding: 8px max(8px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); overflow: hidden; }
.fps-screen[data-dev="pc"] .fps-arena { padding: 24px; }
.fps-field { position: relative; overflow: hidden; border-radius: 14px; background: var(--fps-deep); outline: none; box-shadow: 0 0 0 1px #22304a, 0 24px 60px -30px rgba(0, 0, 0, .9); }
.fps-scene { display: block; }
.fps-say { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 0 20px; text-align: center; pointer-events: none; }
.fps-say b { font: 800 min(44px, 11vw)/1.2 var(--f-round); font-variant-numeric: tabular-nums; text-shadow: 0 2px 16px rgba(0, 0, 0, .8), 0 0 2px #000; word-break: auto-phrase; text-wrap: balance; }
.fps-say span { font: 700 15px/1.6 var(--f-round); max-width: 22em; color: #e8ecf5; text-shadow: 0 1px 8px rgba(0, 0, 0, .9); word-break: auto-phrase; text-wrap: balance; }
.fps-say[data-tone="ok"] b { color: var(--fps-acc); }
.fps-say[data-tone="bad"] b { color: #ff8b98; }
.fps-say[data-tone="count"] b { font-size: min(96px, 24vw); animation: fps-pop .6s ease-out; }
.fps-screen.reduced .fps-say[data-tone="count"] b { animation: none; }
@keyframes fps-pop { from { transform: scale(1.35); opacity: .3; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fps-say[data-tone="count"] b { animation: none; } }
@media (max-height: 460px) {
  .fps-hud { height: calc(40px + env(safe-area-inset-top, 0px)); }
  .fps-say b { font-size: min(32px, 9vw); }
}
