/* 魔法陣メーカー。画面の枠は水文字メーカー(water-maker.css)と同じで、ここは魔法陣だけの見た目。
   キャンバスの地は、光が映える夜の色(明るい画面でも、魔法陣は暗い所で見せる。保存の背景は「背景」の設定に従う) */
.mahoujin-maker .stage { background:radial-gradient(circle at 50% 50%, #1a1430 0%, #0b0913 62%, #05040a 100%); }
.mahoujin-maker .stage .stage-label { box-shadow:0 1px 4px rgba(0,0,0,.25); }
.mahoujin-maker .stage .hint, .mahoujin-maker .stage .tap-hint { color:#ece8ff; text-shadow:0 1px 3px rgba(0,0,0,.6); }
.mahoujin-maker .stage.tappable { cursor:pointer; user-select:none; -webkit-user-select:none; touch-action:manipulation; }
/* 描く手順: なぞってもページが動かない */
.mahoujin-maker .stage.mj-drawing, .mahoujin-maker .stage.mj-drawing canvas { touch-action:none; user-select:none; -webkit-user-select:none; }
.mahoujin-maker .stage.mj-drawing .stage-label { display:inline-flex; align-items:center; gap:6px; }
.mahoujin-maker .stage.mj-drawing .stage-label::before { content:'draw'; font-family:'Material Symbols Rounded'; font-size:14px; font-weight:400; line-height:1; }
.mahoujin-maker .stage:focus-visible { outline:2px solid var(--accent); outline-offset:-4px; }

.mahoujin-maker .mj-section { min-width:0; margin-bottom:12px; }
.mahoujin-maker .mj-section h2 { margin:0 0 6px; }
.mahoujin-maker .mj-note { margin:0 0 12px; color:var(--sub); font-size:12px; line-height:1.5; text-align:center; }

/* 種類のボタン(筆・対称の数・飾り・背景)。数に合わせて等分 */
.mahoujin-maker .mj-options { display:grid; grid-template-columns:repeat(var(--n, 3), minmax(0, 1fr)); gap:6px; }
.mahoujin-maker .mj-option { border-radius:14px; display:flex; align-items:center; justify-content:center; gap:4px; width:100%; height:auto; min-height:44px; padding:6px 2px; white-space:nowrap; }
.mahoujin-maker .mj-option .ms { font-size:18px; }
@media (max-width:420px) { .mahoujin-maker .mj-option { font-size:12px; } .mahoujin-maker .mj-option .ms { font-size:16px; } }

/* 線の太さ・光の強さ(0〜100 のなめらかなスライダー) */
.mahoujin-maker .mj-slider-row { display:grid; grid-template-columns:84px minmax(0, 1fr) 40px; align-items:center; gap:8px; min-height:52px; margin-bottom:12px; padding:0 12px; border:2px solid var(--line); border-radius:14px; background:var(--surface); }
.mahoujin-maker .mj-slider-label { min-width:0; font-size:13px; font-weight:800; line-height:1.25; }
.mahoujin-maker .mj-slider { width:100%; accent-color:var(--accent-hi, var(--accent)); }
.mahoujin-maker .mj-slider-value { font-size:12px; text-align:right; color:var(--accent-hi, var(--accent)); }

/* 1本消す・ぜんぶ消す・おまかせ */
.mahoujin-maker .mj-tools { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:6px; margin-bottom:12px; }
.mahoujin-maker .mj-tools .ghost-btn { min-height:44px; padding:6px 4px; font-size:12px; gap:4px; justify-content:center; }
.mahoujin-maker .mj-tools .ghost-btn:disabled { opacity:.45; }

/* 名前の入力 */
.mahoujin-maker .mj-name { width:100%; box-sizing:border-box; min-height:52px; padding:10px 14px; border:2px solid var(--line); border-radius:14px; background:var(--surface); color:var(--text); font:700 20px/1.2 "Cinzel", "Noto Serif JP", serif; letter-spacing:.12em; text-align:center; }
.mahoujin-maker .mj-name:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

/* 属性の丸(その色で光る) */
.mahoujin-maker .mj-theme-name { display:flex; justify-content:center; margin:2px 0 8px; }
.mahoujin-maker .mj-theme-name b { font-size:17px; }
.mahoujin-maker .mj-palette { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); justify-items:center; gap:10px; padding:4px 4px 8px; }
.mahoujin-maker .mj-dot { width:48px; height:48px; padding:0; border-radius:50%; border:2px solid rgba(255,255,255,.22); cursor:pointer;
  background:radial-gradient(circle, var(--core) 0 18%, var(--dot) 46%, #07050d 100%); color:#fff; font:800 13px/1 "Noto Serif JP", serif; text-shadow:0 0 6px var(--dot), 0 1px 2px #000; }
.mahoujin-maker .mj-dot[aria-pressed="true"] { border-color:#fff; box-shadow:0 0 0 3px var(--accent), 0 0 18px var(--dot); }
.mahoujin-maker .mj-dot:focus-visible { outline:3px solid #fff; outline-offset:3px; }

/* 最初の手順は「もどる」がないので、決めるボタンを横いっぱいにする */
.mahoujin-maker .mahoujin-panel .actions > .btn-main:only-child { flex:1 1 auto; width:100%; }
.mahoujin-maker .mahoujin-panel .actions > .btn-main:only-child { grid-column:1 / -1; }
/* スマホ(縦に並ぶとき)は舞台を正方形にして、なぞる円を大きくする */
@media (max-width:760px) { #lm.mahoujin-maker #stage { aspect-ratio:1 / 1; width:min(calc(100% - 16px), var(--sh)); } }

/* 模様の手順で、まだ線がないときの「なぞって描く」案内。触れたら消え、キャンバスの操作は下へ通す */
.mahoujin-maker .mj-draw-cue { position:absolute; left:50%; top:50%; transform:translate(-50%, -50%); z-index:3; width:min(78%, 320px); display:flex; flex-direction:column; align-items:center; gap:6px; padding:16px 18px 14px; border-radius:18px; background:rgba(12,10,24,.72); border:1px solid rgba(190,170,255,.35); box-shadow:0 0 24px rgba(140,110,255,.25); color:#f1edff; text-align:center; pointer-events:none; animation:mj-cue-in .4s ease-out both; }
.mahoujin-maker .mj-draw-cue[hidden] { display:none; }
.mahoujin-maker .mj-draw-cue b { font-size:16px; line-height:1.35; }
.mahoujin-maker .mj-draw-cue > span:last-child { font-size:12px; line-height:1.5; color:#cfc8ee; }
.mahoujin-maker .mj-draw-cue-hand { display:block; height:40px; }
.mahoujin-maker .mj-draw-cue-hand .ms { font-size:38px; color:#c9b8ff; text-shadow:0 0 10px rgba(170,140,255,.8); animation:mj-cue-trace 2.4s ease-in-out infinite; }
@keyframes mj-cue-in { from { opacity:0; transform:translate(-50%, -46%); } to { opacity:1; transform:translate(-50%, -50%); } }
@keyframes mj-cue-trace { 0%, 100% { transform:translate(-18px, 4px) rotate(-8deg); } 50% { transform:translate(18px, -4px) rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .mahoujin-maker .mj-draw-cue, .mahoujin-maker .mj-draw-cue-hand .ms { animation:none; } }
