/* 博士の実験ミステリー（2026-11-26）。パネル・ボタンの基本は typing.css、ここは事件の画面だけ。 */
.game-bg-mystery { --game-bg: url("game-bg-mystery.webp"); }
body[data-level="junior"] .for-el, body[data-level="elementary"] .for-jh { display: none; }
.mys-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mys-article { --mys-ink: #26295f; --mys-violet: #5b4fd6; --mys-amber: #f2b84b; --mys-line: #d5d9ea; }

/* 見出しの帯：夜の研究室の色。人物の絵は使わず、フラスコと虫めがねで表す。 */
.mys-hero { position: relative; overflow: hidden; margin-bottom: 20px; padding: clamp(22px, 4.5vw, 38px); padding-right: clamp(22px, 30%, 250px); border-radius: 22px; background: radial-gradient(520px 260px at 88% 40%, rgba(242, 184, 75, .2), transparent 70%), linear-gradient(135deg, #23265a, #3a3f8f); color: #fff; box-shadow: 0 14px 32px rgba(38, 41, 95, .22); }
.mys-hero .eyebrow { color: var(--mys-amber); }
.mys-hero h1, .mys-hero h1 span { color: #fff; }
.mys-hero h1 { margin-bottom: 12px; font-size: clamp(1.5rem, 3.6vw, 2.25rem); text-wrap: balance; }
.mys-nb { display: inline-block; }
.mys-hero .typing-lead { color: #dfe2f7; margin-bottom: 0; }
.mys-hero-art { position: absolute; right: clamp(6px, 3%, 26px); bottom: -8px; width: clamp(120px, 26%, 215px); height: auto; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .28)); }

/* 事件えらび */
#mys-select .stage-title b { font-weight: inherit; }
.mys-levels { display: inline-flex; gap: 4px; padding: 4px; margin: 4px 0 12px; border-radius: 14px; background: #e6e9f5; }
.mys-level { min-width: 108px; min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: #4a4f7a; font: inherit; font-weight: 900; cursor: pointer; }
.mys-level[aria-pressed="true"] { background: #fff; color: var(--mys-ink); box-shadow: 0 2px 8px rgba(38, 41, 95, .16); }
.mys-level:focus-visible, .mys-case:focus-visible, .mys-test:focus-visible, .mys-clue:focus-visible, .mys-cand-name:focus-visible, .mys-cand-go:focus-visible, .mys-action:focus-visible, .mys-quit:focus-visible { outline: 3px solid var(--mys-amber); outline-offset: 2px; }
.mys-progress { margin: 0 0 14px; color: #496373; font-weight: 700; }
.mys-cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.mys-case { position: relative; display: grid; gap: 4px; align-content: start; min-height: 148px; padding: 30px 16px 14px; border: 1px solid #e3cf9c; border-radius: 4px 14px 14px 14px; background: linear-gradient(#fff9e8, #fdf1d2); color: var(--mys-ink); font: inherit; text-align: left; cursor: pointer; box-shadow: 0 6px 16px rgba(120, 90, 20, .12); transition: transform .16s ease, box-shadow .16s ease; }
.mys-case::before { content: ""; position: absolute; left: -1px; top: -11px; width: 92px; height: 12px; border: 1px solid #e3cf9c; border-bottom: 0; border-radius: 8px 8px 0 0; background: #fff9e8; }
.mys-case:hover { transform: translateY(-3px); box-shadow: 0 12px 22px rgba(120, 90, 20, .2); }
.mys-case-no { position: absolute; left: 14px; top: 8px; color: #a8791c; font-size: .72rem; font-weight: 900; letter-spacing: .16em; }
.mys-case-title { font-size: 1.18rem; font-weight: 900; line-height: 1.4; }
.mys-case-meta { color: #6a5a3a; font-size: .86rem; font-weight: 700; }
.mys-case-count { color: #7a6f58; font-size: .8rem; }
.mys-case-stars { margin-top: auto; padding-top: 6px; color: #e09a00; font-size: 1.15rem; letter-spacing: .08em; }
.mys-case-stars.is-none { color: #a39a86; font-size: .82rem; font-weight: 800; letter-spacing: 0; }
.mys-case.is-solved { border-color: #d9b860; }
.mys-select-foot { margin: 18px 0 4px; }

/* 事件の画面 */
.mys-play-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.mys-mascot { flex: 0 0 auto; width: 104px; height: auto; margin-top: -6px; }
.mys-brief { flex: 1 1 auto; min-width: 0; }
.mys-intro { position: relative; padding: 10px 14px; border: 1px solid var(--mys-line); border-radius: 4px 14px 14px 14px; background: #f6f7fd; }
.mys-file { margin: 0 0 4px; color: var(--mys-violet); font-size: .8rem; font-weight: 900; letter-spacing: .08em; }
.mys-play h2 { margin-bottom: 8px; font-size: 1.5rem; }
.mys-play h2:focus { outline: none; }
.mys-intro { margin: 0; color: #33475a; line-height: 1.85; }
.mys-result .game-mascot-result { margin-top: -6px; }
.mys-play h3, .mys-result h3 { margin: 0 0 10px; color: var(--mys-ink); font-size: 1.02rem; }
.mys-meter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mys-meter > div { display: flex; align-items: baseline; gap: 6px; padding: 6px 14px; border-radius: 999px; background: #eef0fa; color: #4a4f7a; }
.mys-meter strong { color: var(--mys-ink); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.mys-par { font-size: .82rem; font-weight: 700; }
.mys-board { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mys-stage-wrap { border: 1px solid var(--mys-line); border-radius: 16px; background: linear-gradient(#f7f9fd, #eef2f8); overflow: hidden; }
.mys-stage svg { display: block; width: 100%; height: auto; aspect-ratio: 320 / 200; }
.mys-caption { min-height: 3.5em; margin: 0; padding: 10px 14px 12px; border-top: 1px solid var(--mys-line); background: #fff; color: var(--mys-ink); font-weight: 800; line-height: 1.7; }
.mys-tests { display: grid; gap: 8px; }
.mys-test { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 9px 14px; border: 1px solid #b9bfe6; border-radius: 12px; background: #fff; color: var(--mys-ink); font: inherit; font-weight: 800; line-height: 1.5; text-align: left; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.mys-test:hover:not(:disabled) { background: #f0f1fd; transform: translateX(2px); }
.mys-test-mark { flex: 0 0 26px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--mys-violet); color: #fff; font-size: .7rem; }
.mys-test:disabled { cursor: default; color: #7b809c; background: #f4f5fa; border-color: #dcdfee; }
.mys-test:disabled .mys-test-mark { background: #b7bbd3; }
.mys-test.is-done .mys-test-mark { background: #2e9b6b; font-size: .85rem; }
.mys-feedback { min-height: 0; margin: 14px 0 0; padding: 0; text-align: left; line-height: 1.8; }
.mys-feedback:not(:empty) { padding: 10px 14px; border-radius: 12px; background: #fdeee9; }
.mys-feedback.is-warn:not(:empty) { background: #fff6dc; }
.mys-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; align-items: start; }
.mys-box { padding: 16px; border: 1px solid var(--mys-line); border-radius: 16px; background: #fafbfe; }
.mys-clues { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.mys-empty { color: #6b748c; line-height: 1.7; }
.mys-clue { display: flex; gap: 10px; width: 100%; padding: 9px 12px; border: 1px solid #e3cf9c; border-radius: 10px; background: #fffaea; color: var(--mys-ink); font: inherit; text-align: left; cursor: pointer; }
.mys-clue:hover { background: #fff3d0; }
.mys-clue-no { flex: 0 0 22px; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; background: #e0a100; color: #fff; font-size: .78rem; font-weight: 900; }
.mys-clue-body { display: grid; gap: 2px; }
.mys-clue-test { color: #7a6a3e; font-size: .8rem; font-weight: 700; }
.mys-clue-text { font-weight: 800; line-height: 1.6; }
.mys-clue-hint { margin: 4px 0 0 32px; color: #3f6f2f; font-size: .9rem; font-weight: 700; line-height: 1.6; }
.mys-clue-hint:empty { display: none; }
.mys-action { min-height: 44px; padding: 8px 16px; border: 1px solid #b9bfe6; border-radius: 12px; background: #fff; color: var(--mys-ink); font: inherit; font-weight: 800; cursor: pointer; }
.mys-action:hover:not(:disabled) { background: #f0f1fd; }
.mys-action:disabled, .mys-cand-go:disabled { opacity: .55; cursor: default; }
.mys-note { margin: -4px 0 10px; color: #6b748c; font-size: .86rem; line-height: 1.6; }
.mys-cands { display: grid; gap: 8px; }
.mys-cand { display: flex; align-items: stretch; gap: 6px; }
.mys-cand-name { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px; border: 1px solid #b9bfe6; border-radius: 12px; background: #fff; color: var(--mys-ink); font: inherit; font-weight: 900; line-height: 1.4; text-align: left; cursor: pointer; }
.mys-cand-x { flex: 0 0 22px; display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid #c5c9df; border-radius: 6px; color: #c2452d; font-size: .82rem; font-weight: 900; }
.mys-cand-label small { display: block; color: #6b748c; font-size: .76rem; font-weight: 700; }
.mys-cand.is-out .mys-cand-name { background: #f1f2f6; border-color: #dcdfe8; color: #8a8fa6; }
.mys-cand.is-out .mys-cand-label { text-decoration: line-through; text-decoration-thickness: 2px; }
.mys-cand.is-out .mys-cand-x { border-color: #c2452d; }
.mys-cand-go { flex: 0 0 auto; min-width: 84px; padding: 8px 12px; border: 0; border-radius: 12px; background: var(--mys-ink); color: #fff; font: inherit; font-weight: 900; cursor: pointer; }
.mys-cand-go:hover:not(:disabled) { background: var(--mys-violet); }
.mys-ref { margin-top: 14px; }
.mys-ref table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.mys-ref caption { padding-bottom: 6px; color: var(--mys-ink); font-weight: 900; text-align: left; }
.mys-ref th, .mys-ref td { padding: 6px 10px; border: 1px solid var(--mys-line); background: #fff; }
.mys-ref th { text-align: left; font-weight: 700; }
.mys-ref td { text-align: right; font-variant-numeric: tabular-nums; }
.mys-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 18px; }
.mys-quit { min-height: 44px; padding: 8px 16px; border: 1px solid #c5ccd6; border-radius: 12px; background: #fff; color: #496373; font: inherit; font-weight: 800; cursor: pointer; }

/* 結果 */
.mys-result { text-align: center; }
.mys-solved { display: inline-block; margin: 0 0 10px; padding: 4px 16px; border-radius: 999px; background: var(--mys-ink); color: var(--mys-amber); font-weight: 900; letter-spacing: .1em; }
.mys-result h2 { margin-bottom: 6px; font-size: clamp(1.4rem, 3.4vw, 1.9rem); text-wrap: balance; }
.mys-result h2:focus { outline: none; }
.mys-stars { color: #e09a00; font-size: clamp(2.4rem, 8vw, 3.4rem); line-height: 1.2; letter-spacing: .1em; }
.mys-rank-word { margin: 0 0 14px; color: var(--mys-ink); font-weight: 900; }
.mys-why { margin: 18px 0; padding: 14px 16px; border-radius: 14px; background: #eef0fa; color: var(--mys-ink); font-weight: 700; line-height: 1.85; text-align: left; }
.mys-result h3 { text-align: left; }
.mys-review { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: step; text-align: left; }
.mys-review li { counter-increment: step; display: grid; gap: 2px; padding: 10px 12px 10px 44px; position: relative; border: 1px solid var(--mys-line); border-radius: 12px; background: #fff; }
.mys-review li::before { content: counter(step); position: absolute; left: 12px; top: 12px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e0a100; color: #fff; font-size: .78rem; font-weight: 900; }
.mys-review-test { color: #6b748c; font-size: .82rem; font-weight: 700; }
.mys-review-text { color: var(--mys-ink); font-weight: 800; line-height: 1.6; }
.mys-review-gone { color: #c2452d; font-size: .9rem; font-weight: 800; }
.mys-review-gone.is-none { color: #6b748c; }
.mys-link { margin: 0 0 18px; font-weight: 800; text-align: left; }
.mys-result .typing-result-actions { justify-content: center; }
.mys-other { margin-top: 18px; color: #496373; }

@media (max-width: 720px) {
  .mys-hero { padding-right: clamp(22px, 4.5vw, 38px); }
  .mys-hero-art { right: 4px; bottom: -6px; width: 104px; }
  .mys-hero .typing-lead { padding-right: 92px; }
  .mys-mascot { width: 72px; }
  .mys-play-head { gap: 10px; }
  .mys-board, .mys-cols { grid-template-columns: 1fr; gap: 14px; }
  .mys-cases { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mys-case { min-height: 132px; padding: 28px 12px 12px; }
  .mys-case-title { font-size: 1.02rem; }
  .mys-level { min-width: 0; padding: 0 22px; }
  .mys-box { padding: 14px 12px; }
}
@media (max-width: 380px) { .mys-cases { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .mys-case, .mys-test { transition: none; } .mys-case:hover, .mys-test:hover:not(:disabled) { transform: none; } }

/* トップページの入口（home.html） */
.game-promo-card.is-mystery { grid-column: 1 / -1; flex-direction: row; align-items: stretch; background: linear-gradient(135deg, #23265a, #3a3f8f); border-color: #2f3276; }
.is-mystery .game-promo-art { flex: 0 0 34%; height: auto; min-height: 150px; display: grid; place-items: center; background: radial-gradient(closest-side, rgba(242, 184, 75, .28), transparent); }
.is-mystery .game-promo-art::after { content: none; }
.is-mystery .game-promo-art img { position: static; width: min(74%, 178px); height: auto; margin-bottom: -10px; align-self: end; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .28)); }
.is-mystery .game-promo-body { flex: 1 1 auto; justify-content: center; }
.is-mystery .game-promo-name { color: #fff; }
.is-mystery .game-promo-sub { color: #f2b84b; }
.is-mystery .game-promo-text { color: #dfe2f7; padding-right: 0; }
.is-mystery .game-promo-go { background: #f2b84b; color: #23265a; }
.game-promo-grid + .typing-device-note { margin-top: 14px; }
.game-badge.is-new { background: #f2b84b; color: #23265a; }
@media (max-width: 720px) {
  .game-promo-card.is-mystery { flex-direction: column; }
  .is-mystery .game-promo-art { flex-basis: auto; min-height: 120px; }
  .is-mystery .game-promo-art img { width: 128px; }
}
