/* sci-magnet（じしゃく）。N＝赤・S＝青（S-028）、引き合う／しりぞけ合う の 矢じるし＝みどり（S-029）。字は 16px 以上 */
.mg { font-size: 1.05rem; }
.mg [hidden] { display: none !important; }
.mg-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.mg-tab { min-height: 46px; padding: 2px 16px; border: 2px solid var(--line, #e5e7eb); background: #fff; border-radius: 999px; font-weight: 700; font-size: 1rem; color: var(--ink, #1f2937); cursor: pointer; }
.mg-tab[aria-pressed="true"] { background: var(--ink, #1f2937); color: #fff; border-color: var(--ink, #1f2937); }
.mg-guess { background: #fff8e6; border: 2px solid var(--orange, #f59e0b); border-radius: 12px; padding: 8px 12px 10px; margin-bottom: 8px; }
.mg-ask { font-weight: 700; margin: 0 0 6px; font-size: 1.1rem; }
.mg-gb, .mg-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.mg-pick { margin-bottom: 8px; }
.mg-g, .mg-b, .mg-it { min-height: 50px; min-width: 50px; padding: 4px 16px; border: 2px solid var(--ink, #1f2937); background: #fff; border-radius: 12px; font-weight: 700; font-size: 1.05rem; color: var(--ink, #1f2937); cursor: pointer; }
.mg-it { min-height: 46px; padding: 2px 12px; font-size: 1rem; }
.mg-it[aria-pressed="true"], .mg-b[aria-pressed="true"] { background: #fff4dc; border-color: #ea580c; }
.mg-g:disabled, .mg-b:disabled, .mg-go:disabled { opacity: .45; cursor: default; }
.mg-g[aria-pressed="true"] { opacity: 1; background: #eaf1ff; border-color: #2563eb; }
.mg-svg { width: 100%; height: auto; display: block; margin: 4px 0; user-select: none; -webkit-user-select: none; touch-action: none; border-radius: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.mg-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0 10px; }
.mg-go { min-height: 54px; padding: 6px 22px; border: 0; border-radius: 14px; background: var(--teal-d, #0f8a72); color: #fff; font-weight: 700; font-size: 1.1rem; cursor: pointer; box-shadow: 0 3px 0 #0a6553; }
.mg-go:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a6553; }
.mg-read { background: #f3f6ff; border-radius: 12px; padding: 8px 14px; min-height: 56px; }
.mg-read p { margin: 4px 0; }
.mg-res { font-weight: 700; color: var(--teal-d, #0f8a72); }
.mg-res.ng { color: #c2410c; }
.mg-note { font-size: 1rem; color: var(--sub, #4b5563); }
.mg-sum { font-weight: 700; color: #0f5f50; background: #e7f6f1; border-radius: 10px; padding: 6px 10px; }
.mg-rec { margin-top: 10px; }
.mg-tbl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mg-tbl > div { border: 2px solid #e5e7eb; border-radius: 12px; padding: 6px 8px; display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.mg-tbl b { width: 100%; font-size: 1rem; }
.mg-tbl span { border-radius: 999px; padding: 1px 10px; font-size: .95rem; font-weight: 700; }
.mg-tbl span small { font-weight: 400; font-size: .85rem; }
.mg-tbl .y { background: #e3f4ec; color: #0f6b4f; }
.mg-tbl .n { background: #eceff3; color: #4b5563; }
.mg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mg-grid > div { border: 2px solid #e5e7eb; border-radius: 12px; padding: 4px 8px; text-align: center; font-weight: 700; }
.mg-grid > div b { display: block; font-size: 1.1rem; }
.mg-grid .attract { border-color: #2f8f6f; background: #eef8f3; }
.mg-grid .repel { border-color: #c2410c; background: #fff4ec; }
.mg-grid i, i.mg-p { font-style: normal; font-weight: 800; padding: 0 5px; border-radius: 4px; color: #fff; margin: 0 2px; }
.mg i.N { background: #df3e47; } .mg i.S { background: #2876c3; }
.mg-b-n { color: #c62828; } .mg-b-s { color: #1d5fa8; }
/* SVG */
.mg-lab { font-size: 20px; font-weight: 700; fill: #374151; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.mg-sm { font-size: 18px; font-weight: 700; fill: #6b7280; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.mg-q { font-size: 30px; font-weight: 800; fill: #2563eb; paint-order: stroke; stroke: #fff; stroke-width: 5px; pointer-events: none; }
.mg-pole { fill: #fff; font-weight: 800; font-family: "DejaVu Sans", "Arial", sans-serif; pointer-events: none; }
.mg-ol { stroke: #333; stroke-width: 2; stroke-linejoin: round; }
.mg-ol1 { stroke: #333; stroke-width: 1.4; stroke-linejoin: round; }
.mg-ol2 { stroke: #333; stroke-width: 2.6; stroke-linejoin: round; }
.mg-sh { fill: #333; opacity: .12; }
.mg-arw { fill: #3f9a7a; stroke: #1f5f4a; stroke-width: 2; stroke-linejoin: round; }
.mg-arr { animation: mg-pop .35s ease-out; }
.mg-thr { fill: none; stroke: #7a6a55; stroke-width: 1.6; }
.mg-dim path { fill: none; stroke: #2563eb; stroke-width: 1.6; }
.mg-mf { fill: #f97316; transition: y .12s, height .12s; }
.mg-grab { cursor: grab; }
@keyframes mg-pop { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mg-arr { animation: none; } .mg-mf { transition: none; } }
