/* M.A.T.H. opt-in motion — isolating all new styles from existing gameplay */
.math-motion-gallery{max-width:1220px;margin:24px auto;padding:clamp(20px,4vw,36px);border:1px solid #d6b04e;border-radius:24px;background:linear-gradient(125deg,#082645,#174d7e 58%,#0d2c4e);box-shadow:0 12px 35px #051d3955;color:#fff;box-sizing:border-box}
.math-motion-gallery h2{font-family:Georgia,serif;margin:.25em 0;font-size:clamp(1.5rem,3.2vw,2.6rem);color:#ffe6a4}
.math-motion-gallery p{max-width:850px;line-height:1.55;color:#e6edf6}
.math-motion-eyebrow{letter-spacing:.14em;font-size:.72rem;font-weight:800;color:#ffdc81}
.math-motion-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:17px}
.math-motion-tile{display:flex;align-items:center;gap:12px;border:1px solid #d8b65788;background:#ffffff12;color:#fff;padding:10px;text-align:left;border-radius:15px;cursor:pointer;min-height:92px;min-width:0}
.math-motion-tile:hover,.math-motion-tile:focus-visible{background:#ffffff29;border-color:#ffd777;outline-offset:3px}
.math-motion-tile img{width:72px;height:72px;object-fit:contain;flex:none;filter:drop-shadow(0 3px 8px #0006)}
.math-motion-tile span{min-width:0;display:grid;gap:4px}.math-motion-tile b{font-size:.95rem}.math-motion-tile small{color:#f1dca9;font-size:.75rem}
.math-motion-more{margin-top:16px}.math-motion-more summary{cursor:pointer;font-weight:800;color:#ffe5a7}
.math-motion-settings{display:flex;gap:12px;flex-wrap:wrap;margin-top:18px}
.math-motion-quiet{border:1px solid #f4d58777;background:transparent;border-radius:18px;color:white;padding:9px 13px;cursor:pointer}
.math-motion-pop{position:fixed;z-index:2147482000;right:12px;bottom:12px;width:min(390px,calc(100vw - 24px));box-sizing:border-box;background:#071e36;color:#fff;border:2px solid #e6bd60;box-shadow:0 10px 45px #0009;border-radius:18px;overflow:hidden;font-family:system-ui,sans-serif}
.math-motion-pop-head{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:#174678;gap:10px}
.math-motion-pop-head strong{font-size:.92rem}.math-motion-close{background:#ffffff22;color:#fff;border:1px solid #ffffff66;border-radius:99px;min-width:34px;min-height:34px;font-size:22px;cursor:pointer}
.math-motion-stage{background:#06182a;aspect-ratio:16/9;display:grid;place-items:center}
.math-motion-stage video{display:block;width:100%;height:100%;object-fit:contain}
.math-motion-fallback{font-size:.86rem;padding:10px}.math-motion-context{padding:8px 14px 0;margin:0;font-size:.87rem;line-height:1.4;color:#e7f0f8}
.math-motion-pop-footer{display:flex;align-items:center;gap:9px;flex-wrap:wrap;padding:12px}
.math-motion-pop-footer button,.math-motion-origin{border:1px solid #f3d79a88;border-radius:10px;background:#164b7f;color:white;padding:9px;font-size:.8rem;cursor:pointer;text-decoration:none}
.math-motion-pop-footer .math-motion-muted{background:none;color:#e6e6e6}
@media(max-width:740px){.math-motion-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.math-motion-tile{min-height:76px;gap:7px}.math-motion-tile img{width:46px;height:52px}}
@media(max-width:365px){.math-motion-grid{grid-template-columns:1fr}.math-motion-pop{bottom:5px;right:5px;width:calc(100vw - 10px)}}
@media(prefers-reduced-motion:reduce){.math-motion-pop,.math-motion-gallery *{animation:none!important;transition:none!important}}

.math-motion-enter{display:inline-block;margin-top:18px;padding:12px 18px;border-radius:13px;background:#e8ba5b;color:#15263b!important;text-decoration:none;font-weight:900}
.math-motion-enter:focus-visible{outline:3px solid #fff;outline-offset:3px}
