/* マウスれんしゅう2 共通スタイル */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'BIZ UDPGothic', 'Meiryo', sans-serif;
  user-select: none; -webkit-user-select: none;
  touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
  color: #2b3a55;
}
body.m2-cursor-big, body.m2-cursor-big * { cursor: none !important; }

/* ---------- カーソル（本物の矢印に近い形を大きく表示） ---------- */
#m2-cursor {
  position: fixed; left: 0; top: 0; width: 0; height: 0;
  pointer-events: none; z-index: 9500; opacity: 0;
  will-change: transform;
}
#m2-cursor .halo {
  position: absolute; left: -38px; top: -38px; width: 76px; height: 76px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,226,70,.55) 0%, rgba(255,226,70,.28) 45%, rgba(255,226,70,0) 70%);
  transition: transform .12s, background .12s;
}
body.m2-pressed #m2-cursor .halo {
  transform: scale(.75);
  background: radial-gradient(circle, rgba(255,120,60,.65) 0%, rgba(255,120,60,.3) 45%, rgba(255,120,60,0) 70%);
}
#m2-cursor svg, #m2-ghost svg.arrow {
  position: absolute; left: -2px; top: -2px; width: 34px; height: 50px; overflow: visible;
  transform: scale(1.45); transform-origin: 2px 2px;
  filter: drop-shadow(1px 2px 2px rgba(0,0,0,.35));
}
body.m2-cursor-normal #m2-cursor svg { display: none; }
#m2-cursor .tool { position: absolute; left: 26px; top: 40px; font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.m2-ripple { position: fixed; width: 90px; height: 90px; border-radius: 50%; pointer-events: none; z-index: 9350;
  border: 5px solid rgba(255,140,60,.9); box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
body.m2-cursor-normal, body.m2-cursor-normal * { cursor: default !important; }
/* 元のゲームの部品のうち、共通UIに置きかえたもの */
#home-btn, #level-stars, #cursor { display: none !important; }

/* ---------- 上のバー ---------- */
.m2-ui { position: fixed; z-index: 9000; }
#m2-home {
  top: 14px; left: 14px; width: 68px; height: 68px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.92); box-shadow: 0 3px 10px rgba(0,0,0,.18);
  font-size: 32px; display: grid; place-items: center; cursor: pointer;
}
#m2-home svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
#m2-home circle { fill: none; stroke-width: 6; }
#m2-home .track { stroke: rgba(0,0,0,.06); }
#m2-home .ring { stroke: #ff7a59; stroke-linecap: round; stroke-dasharray: 182.2; stroke-dashoffset: 182.2; }
#m2-home span { position: relative; line-height: 1; }
#m2-home.wiggle { animation: m2wiggle .45s; }
@keyframes m2wiggle { 0%,100%{transform:rotate(0)} 25%{transform:rotate(-12deg)} 75%{transform:rotate(12deg)} }
#m2-tip {
  top: 92px; left: 14px; background: #2b3a55; color: #fff; font-size: 15px; font-weight: 800;
  padding: 8px 14px; border-radius: 12px; opacity: 0; transition: opacity .2s; pointer-events: none;
}
#m2-tip.show { opacity: 1; }

#m2-progress {
  top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 6px 14px; border-radius: 40px;
  background: rgba(255,255,255,.75); box-shadow: 0 3px 10px rgba(0,0,0,.12);
  pointer-events: none; min-height: 60px; align-items: center;
}
#m2-progress:empty { display: none; }
#m2-progress .dot {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-size: 34px; line-height: 1;
}
#m2-progress .dot.empty { background: rgba(43,58,85,.1); box-shadow: inset 0 0 0 3px rgba(43,58,85,.12); }
#m2-progress .dot.new { animation: m2pop .5s cubic-bezier(.3,1.8,.5,1); }
@keyframes m2pop { 0%{transform:scale(.2)} 100%{transform:scale(1)} }

#m2-right { top: 14px; right: 14px; display: flex; gap: 10px; align-items: center; }
#m2-stars {
  background: rgba(255,255,255,.85); border-radius: 40px; padding: 8px 16px;
  font-size: 26px; font-weight: 800; box-shadow: 0 3px 10px rgba(0,0,0,.12); pointer-events: none; white-space: nowrap;
}
#m2-voice {
  width: 56px; height: 56px; border-radius: 50%; border: none; background: rgba(255,255,255,.92);
  box-shadow: 0 3px 10px rgba(0,0,0,.18); font-size: 28px; cursor: pointer;
}

/* ---------- お手本（ゴースト） ---------- */
#m2-ghost { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 9400; pointer-events: none; display: none; }
#m2-ghost svg.arrow path { fill: #ff8fb1; stroke: #fff; }
#m2-ghost svg.arrow { opacity: .9; }
#m2-ghost .g-ring {
  position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; border-radius: 50%;
  border: 6px solid #ff5a8a; opacity: 0;
}
#m2-ghost .g-hold {
  position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,90,138,.45); opacity: 0;
}
#m2-ghost .g-carry {
  position: absolute; left: -50px; top: -50px; width: 100px; height: 100px;
  display: grid; place-items: center; font-size: 72px; opacity: 0;
}
#m2-ghost-mouse { position: fixed; z-index: 9400; pointer-events: none; display: none; width: 120px; height: 150px; }
#m2-ghost-mouse svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 4px 8px rgba(0,0,0,.25)); }

/* ---------- お祝い ---------- */
.m2-toast {
  position: fixed; left: 50%; top: 18%; z-index: 9300; pointer-events: none;
  background: rgba(255,255,255,.95); border-radius: 30px; padding: 14px 30px 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25); text-align: center;
}
.m2-toast .big { font-size: 96px; line-height: 1.1; display: block; }
.m2-toast .label { font-size: 22px; font-weight: 800; color: #ff6a3d; }
#m2-celebrate {
  position: fixed; inset: 0; z-index: 9300; display: none; place-items: center; pointer-events: none;
}
#m2-celebrate .card {
  background: rgba(255,255,255,.95); border-radius: 36px; padding: 26px 46px 22px;
  box-shadow: 0 16px 50px rgba(0,0,0,.25); text-align: center;
}
#m2-celebrate .big { font-size: 140px; line-height: 1.1; display: block; }
#m2-celebrate .label { font-size: 30px; font-weight: 800; color: #ff6a3d; letter-spacing: .05em; }
.m2-particle { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 9200; line-height: 1; will-change: transform, opacity; }

/* ---------- スマホ・タブレット ---------- */
body.m2-touch #m2-cursor { display: none; }
#m2-ghost .g-finger { position: absolute; left: -24px; top: -6px; font-size: 52px; line-height: 1; display: none; }
body.m2-touch #m2-ghost svg.arrow { display: none; }
body.m2-touch #m2-ghost .g-finger { display: block; }
@media (max-width: 600px) {
  #m2-home { width: 52px; height: 52px; font-size: 24px; top: 10px; left: 10px; }
  #m2-tip { top: 70px; left: 10px; font-size: 13px; }
  #m2-right { top: 10px; right: 10px; gap: 6px; }
  #m2-stars { font-size: 18px; padding: 6px 10px; }
  #m2-voice { width: 44px; height: 44px; font-size: 22px; }
  #m2-progress { top: 72px; min-height: 44px; padding: 4px 10px; gap: 4px; }
  #m2-progress .dot { width: 32px; height: 32px; font-size: 24px; }
  .m2-toast .big { font-size: 64px; }
  .m2-toast .label { font-size: 16px; }
}

/* 達成マークと 星が かさなるときは、達成マークを1段下へ（common.js の fitTop） */
body.m2-stack #m2-progress, body.m2-stack #progress-icons, body.m2-stack #score-icons { top: 86px !important; }
