/* ポロとむすびの迷宮 紹介ページの遊び（assets/js/polomusubi-play.js）：ひょっこり魔獣・なかまずかん・今日の魔獣 */
.pm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pm-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.pm-lane { position: relative; height: 0; max-width: 800px; margin: 0 auto; pointer-events: none; z-index: 3; }

/* 魔獣（ドット絵は整数倍で、ぼかさない） */
.pm-mon {
  position: absolute; width: 64px; height: 64px; padding: 0; margin: 0; border: 0; background: none;
  cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pm-mon img { display: block; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }
.pm-walk { bottom: 1px; }
.pm-walk img, .pm-sit img { animation: pm-hop .6s steps(1, end) infinite; }
.pm-flip img { scale: -1 1; }
.pm-sit { bottom: 1px; }
.pm-stay img { animation: pm-jump .45s steps(4, end) 1; }
.pm-leave { opacity: 0; transition: opacity .4s; }
@keyframes pm-hop { 0% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes pm-jump { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* 画面の下から顔を出す */
.pm-peek { position: absolute; bottom: 0; transform: translateY(105%); transition: transform .5s steps(6, end); }
.pm-peek.pm-up { transform: translateY(38%); }
.pm-peek.pm-big { width: 128px; height: 128px; }

/* ふきだし・ハート */
.pm-bubble {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font: 500 .75rem 'Noto Sans JP', sans-serif; color: var(--text-main); background: #261e3d; border: 1px solid var(--glass-border);
  border-radius: 8px; padding: .25rem .6rem; animation: pm-pop 1.8s ease-out forwards; z-index: 5;
}
.pm-bubble.pm-new { color: #2a1c00; background: var(--primary); border-color: var(--primary); font-weight: 700; }
@keyframes pm-pop { 0% { opacity: 0; margin-bottom: -6px; } 12% { opacity: 1; margin-bottom: 4px; } 80% { opacity: 1; } 100% { opacity: 0; margin-bottom: 10px; } }
.pm-heart { position: absolute; bottom: 55%; color: #ff8aa8; font-size: .9rem; pointer-events: none; animation: pm-heart 1.2s ease-out forwards; }
@keyframes pm-heart { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-34px); } }

/* 右下のボタン */
.pm-dock {
  position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 70;
  display: flex; align-items: center; gap: 6px;
}
.pm-dex, .pm-play {
  min-height: 44px; border: 1px solid var(--glass-border); border-radius: 999px; background: rgba(32, 25, 52, .94);
  color: var(--text-main); cursor: pointer; font: 500 .78rem 'JetBrains Mono', monospace; -webkit-tap-highlight-color: transparent;
}
.pm-dex { display: inline-flex; align-items: center; gap: 4px; padding: 0 .9rem 0 .35rem; }
.pm-dex-icon { image-rendering: pixelated; width: 32px; height: 32px; }
.pm-play { padding: 0 .8rem; font-size: .72rem; color: var(--text-sub); }
.pm-dex:hover, .pm-play:hover, .pm-dex:focus-visible, .pm-play:focus-visible { border-color: var(--primary); }
.pm-complete .pm-dex { border-color: var(--primary); box-shadow: 0 0 16px var(--glow); }

/* なかまずかん（シート） */
html.pm-lock { overflow: hidden; }
.pm-back { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(8, 6, 16, .72); }
.pm-back[hidden] { display: none; }
.pm-sheet {
  width: min(560px, 100%); max-height: min(86vh, 720px); overflow-y: auto; padding: 1.1rem 1.25rem 1.25rem;
  background: #1d1730; border: 1px solid var(--glass-border); border-radius: 16px; color: var(--text-main);
}
.pm-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pm-sheet-head h3 { font-family: 'Syne', 'Noto Sans JP', sans-serif; font-size: 1.1rem; color: var(--primary-light); margin: 0; }
.pm-x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--glass-border); background: none; color: var(--text-main); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.pm-x:hover, .pm-x:focus-visible { border-color: var(--primary); }
.pm-status { font: 500 .8rem 'JetBrains Mono', monospace; color: var(--primary); margin: .25rem 0 .75rem; }
.pm-polo { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; padding: .5rem .75rem; border-radius: 12px; background: rgba(242, 193, 78, .1); font-size: .85rem; }
.pm-polo[hidden] { display: none; }
.pm-polo img { image-rendering: pixelated; width: 64px; height: 48px; flex-shrink: 0; }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.pm-cell { text-align: center; padding: .4rem .2rem .3rem; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.pm-cell img { display: block; margin: 0 auto; width: 64px; height: 64px; image-rendering: pixelated; filter: brightness(0); opacity: .35; }
.pm-cell.got img { filter: none; opacity: 1; }
.pm-cell-name { display: block; font-size: .68rem; color: var(--text-sub); margin-top: .15rem; }
.pm-cell.got .pm-cell-name { color: var(--text-main); }
.pm-hint { font-size: .8rem; line-height: 1.7; color: var(--text-sub); margin: .9rem 0 0; }
.pm-sheet-foot { margin-top: .75rem; text-align: right; }
.pm-reset { background: none; border: 1px solid var(--glass-border); border-radius: 999px; padding: .5rem 1rem; min-height: 44px; font-size: .75rem; color: var(--text-sub); cursor: pointer; }
.pm-reset[hidden] { display: none; }
.pm-reset.pm-warn { color: #ffb4a8; border-color: #ffb4a8; }
@media (max-width: 480px) { .pm-back { align-items: flex-end; padding: 0; } .pm-sheet { border-radius: 16px 16px 0 0; max-height: 88vh; } }

/* 今日の魔獣（ホームの上） */
.pm-today { max-width: 440px; margin: 1.75rem auto 0; }
.pm-today[hidden] { display: none; }
.pm-today-body { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1rem; padding: .75rem 1rem; text-align: left; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 16px; }
.pm-today-pic { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.pm-today-pic img { display: block; width: 64px; height: 64px; image-rendering: pixelated; }
.pm-today-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 140px; }
.pm-today-label { font: 500 .7rem 'JetBrains Mono', monospace; letter-spacing: .08em; color: var(--primary); }
.pm-today-name { font-size: 1.05rem; color: var(--text-main); }
.pm-today-meta { font-size: .8rem; color: var(--text-sub); }
.pm-today-btn { min-height: 44px; padding: 0 1.1rem; border: 0; border-radius: 999px; background: var(--primary); color: #2a1c00; font-weight: 700; font-size: .85rem; cursor: pointer; }
.pm-today-btn.pm-done { background: transparent; border: 1px solid var(--glass-border); color: var(--text-sub); font-weight: 500; }
.pm-today-btn:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .pm-walk img, .pm-sit img, .pm-stay img { animation: none; }
  .pm-peek { transition: none; }
  .pm-bubble { animation: none; opacity: 1; margin-bottom: 4px; }
}
