/* 3D Mahjong: a WebGL canvas fills the stage; the HUD, menu and dialogs are HTML on top */
.m3d { display: flex; flex-direction: column; color: #fff; }
.m3d-stage { --m3d-hue: 205; position: relative; width: 100%; height: min(80vh, 780px); min-height: 420px; overflow: hidden; border-radius: 10px; outline: none;
  background: radial-gradient(120% 85% at 50% 38%, hsl(var(--m3d-hue) 52% 34%), hsl(var(--m3d-hue) 58% 17%) 58%, #080c1f 100%);
  transition: background .6s;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
/* on a phone the stage is never taller than the window less the site header, so it fits whole once the game scrolls itself into view */
@media (max-width: 600px) { .m3d-stage { height: auto; aspect-ratio: 9 / 15; max-height: 82vh; max-height: min(82vh, calc(100svh - 62px)); min-height: 0; border-radius: 8px; } }
.m3d-stage::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background: radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 82% 12%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 68% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 8%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 92% 44%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 6% 52%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 44% 14%, #fff 50%, transparent 51%); }
.m3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; }
/* on the menu a swipe up or down on the picture scrolls the page; on a board every touch belongs to the shape */
.m3d-stage.is-menu .m3d-canvas { touch-action: pan-y; }
.m3d-canvas.is-point { cursor: pointer; } .m3d-canvas.is-drag { cursor: grabbing; }
.m3d-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.m3d [hidden] { display: none !important; }
.m3d svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.m3d button { font: inherit; touch-action: manipulation; }

/* ---------- HUD ---------- */
.m3d-hud { position: absolute; inset: 0; pointer-events: none; }
.m3d-top { position: absolute; left: 10px; right: 10px; top: max(10px, env(safe-area-inset-top, 0px)); display: flex; align-items: center; gap: 8px; }
.m3d-where { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 4px 12px; border-radius: 12px; background: rgba(6,10,30,0.46); line-height: 1.15; }
.m3d-where b { font-size: 15px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m3d-where span { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m3d-where span:empty { display: none; }
.m3d-stat { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; min-height: 44px; padding: 4px 10px; border-radius: 12px; background: rgba(6,10,30,0.46); line-height: 1.1; }
.m3d-stat small { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.72); }
.m3d-stat b { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.m3d-stat.is-low { background: rgba(222,48,60,0.9); animation: m3d-blink .5s ease-in-out infinite alternate; }
.m3d-stat.is-gain b { animation: m3d-bump .35s ease-out; color: #9dffb4; }
@keyframes m3d-blink { to { background: rgba(140,20,40,0.9); } }
@keyframes m3d-bump { 40% { transform: scale(1.25); } }
.m3d-ibtn { flex: 0 0 auto; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 12px; background: rgba(6,10,30,0.5); color: #fff; cursor: pointer; pointer-events: auto; transition: background .15s, transform .1s; }
.m3d-ibtn:hover { background: rgba(6,10,30,0.7); } .m3d-ibtn:active { transform: scale(0.94); }
.m3d-ibtn svg { width: 22px; height: 22px; stroke-width: 3; }
.m3d-sub { position: absolute; left: 10px; right: 10px; top: calc(max(10px, env(safe-area-inset-top, 0px)) + 54px); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.m3d-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 11px; border-radius: 99px; background: rgba(6,10,30,0.46); font-size: 13px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m3d-chip:empty { display: none; }
.m3d-goal svg { width: 15px; height: 15px; stroke: none; fill: #ffd166; } .m3d-goal svg.is-off { fill: rgba(255,255,255,0.3); }
.m3d-goal .m3d-stars { display: inline-flex; gap: 1px; }
.m3d-combo { background: linear-gradient(90deg, #ff7a3c, #ffc93c); color: #3a1c00; padding-right: 10px; }
.m3d-combo b { font-size: 14px; font-weight: 900; }
.m3d-combo i { display: block; width: 44px; height: 6px; border-radius: 99px; background: rgba(58,28,0,0.28); overflow: hidden; }
.m3d-combo u { display: block; height: 100%; width: 100%; background: #3a1c00; border-radius: inherit; transform-origin: 0 50%; }
.m3d-combo.is-bump { animation: m3d-bump .25s ease-out; }
.m3d-held { padding: 2px 11px 2px 3px; background: rgba(255,209,102,0.95); color: #3a2500; }
.m3d-held canvas { width: 26px; height: 26px; border-radius: 6px; }
.m3d-pops { position: absolute; inset: 0; overflow: hidden; }
.m3d-pop { position: absolute; transform: translate(-50%, -50%); font-size: 22px; font-weight: 900; color: #fff; white-space: nowrap; text-shadow: 0 2px 0 rgba(6,10,30,0.55), 0 0 12px rgba(255,220,120,0.9); animation: m3d-pop 0.9s ease-out forwards; }
.m3d-pop small { margin-left: 5px; font-size: 15px; color: #ffd166; }
.m3d-pop.is-twin { color: #b9f7ff; }
@keyframes m3d-pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.12); } 30% { transform: translate(-50%, -70%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -150%) scale(1); } }

.m3d-bar { position: absolute; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; gap: 7px; }
.m3d-tbtn { position: relative; flex: 1 1 0; max-width: 104px; min-width: 0; min-height: 56px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 5px 4px; border: 0; border-radius: 14px;
  background: rgba(6,10,30,0.56); color: #fff; font-size: 12px; font-weight: 800; cursor: pointer; pointer-events: auto; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); transition: background .15s, transform .1s, opacity .2s; }
.m3d-tbtn svg { width: 22px; height: 22px; }
.m3d-tbtn:hover { background: rgba(6,10,30,0.76); } .m3d-tbtn:active { transform: scale(0.95); }
.m3d-tbtn:disabled { opacity: 0.42; cursor: default; transform: none; }
.m3d-turn { max-width: 64px; background: rgba(255,255,255,0.16); } .m3d-turn svg { width: 26px; height: 26px; stroke-width: 2.6; }
.m3d-n { position: absolute; right: -4px; top: -8px; min-width: 22px; height: 22px; padding: 0 6px; box-shadow: 0 0 0 2px rgba(6,10,30,0.55); display: grid; place-items: center; border-radius: 99px; background: #ffd166; color: #3a2500; font-size: 12px; font-weight: 900; }
.m3d-n:empty { display: none; }
.m3d-coach { position: absolute; left: 50%; bottom: calc(max(10px, env(safe-area-inset-bottom, 0px)) + 68px); transform: translateX(-50%); width: min(94%, 440px); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 14px 6px; border-radius: 16px;
  background: #fff; color: #1b2550; text-align: center; box-shadow: 0 6px 0 rgba(6,10,30,0.25), 0 12px 30px rgba(6,10,30,0.35); pointer-events: auto; animation: m3d-in .3s cubic-bezier(.2,1.3,.4,1); }
.m3d-coach p { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.35; }
.m3d-skip { min-height: 40px; padding: 4px 14px; border: 0; background: none; color: #5a6690; font-size: 13px; font-weight: 800; text-decoration: underline; cursor: pointer; }

/* ---------- menu ---------- */
.m3d-title { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 18px 14px 12px; pointer-events: none; text-align: center; }
.m3d-logo { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: 0.9; font-size: clamp(40px, 10vmin, 68px); font-weight: 900; letter-spacing: 0.01em; text-transform: uppercase; color: #fff;
  text-shadow: 0 4px 0 rgba(6,10,30,0.5), 0 10px 22px rgba(6,10,30,0.4); animation: m3d-logo-in .6s cubic-bezier(.2,1.4,.4,1) both; }
.m3d-logo span:first-child { color: #ffd166; }
@keyframes m3d-logo-in { from { transform: translateY(-30px) scale(0.9); opacity: 0; } }
.m3d-prog { margin: 10px 0 0; min-height: 1.2em; font-size: 14px; font-weight: 800; color: rgba(255,255,255,0.9); text-shadow: 0 2px 0 rgba(6,10,30,0.4); }
.m3d-prog svg { width: 16px; height: 16px; margin-right: 5px; vertical-align: -2px; fill: #ffd166; stroke: none; }
.m3d-menu { width: 100%; max-width: 372px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; pointer-events: auto; }
.m3d-go { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 66px; padding: 8px 18px; border: 0; border-radius: 18px; background: #ffd166; color: #3a2500; cursor: pointer; box-shadow: 0 5px 0 #c9861e, 0 10px 24px rgba(6,10,30,0.35); transition: transform .1s, box-shadow .1s, opacity .2s; }
.m3d-go svg { width: 30px; height: 30px; fill: currentColor; stroke: none; }
.m3d-go span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.m3d-go b { font-size: 24px; font-weight: 900; } .m3d-go small { font-size: 13px; font-weight: 800; opacity: 0.8; }
.m3d-go:hover { transform: translateY(-1px); } .m3d-go:active { transform: translateY(4px); box-shadow: 0 1px 0 #c9861e; }
.m3d-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.m3d-mbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 50px; padding: 6px 8px; border: 0; border-radius: 14px; background: rgba(255,255,255,0.95); color: #1b2550; font-size: 15px; font-weight: 900; cursor: pointer;
  box-shadow: 0 4px 0 rgba(6,10,30,0.3); transition: transform .1s, box-shadow .1s, opacity .2s; }
.m3d-mbtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m3d-mbtn svg { flex: 0 0 auto; width: 22px; height: 22px; }
.m3d-mbtn:hover { transform: translateY(-1px); } .m3d-mbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(6,10,30,0.3); }
.m3d-go:disabled, .m3d-mbtn:disabled { opacity: 0.55; cursor: progress; transform: none; }
.m3d-dbest { margin: 0; min-height: 0; font-size: 13px; font-weight: 800; color: rgba(255,255,255,0.92); text-shadow: 0 2px 0 rgba(6,10,30,0.4); }
.m3d-dbest:empty, .m3d-dbest span:empty { display: none; }
.m3d-toggles { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.m3d-tog { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px; border: 0; border-radius: 99px; background: rgba(6,10,30,0.5); color: #fff; font-size: 13px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.m3d-tog svg { width: 18px; height: 18px; }
.m3d-tog .off { display: none; } .m3d-tog[aria-pressed="false"] .on { display: none; } .m3d-tog[aria-pressed="false"] .off { display: inline; } .m3d-tog[aria-pressed="false"] { color: rgba(255,255,255,0.62); }
.m3d-ibtn:focus-visible, .m3d-tbtn:focus-visible, .m3d-go:focus-visible, .m3d-mbtn:focus-visible, .m3d-tog:focus-visible, .m3d-skip:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px rgba(27,37,80,0.7); }
.m3d-stage:focus-visible { box-shadow: inset 0 0 0 3px rgba(255,255,255,0.75); }

/* ---------- toast, loading ---------- */
.m3d-toast { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); max-width: 92%; padding: 10px 16px; border-radius: 14px; background: rgba(6,10,30,0.82); font-size: 16px; font-weight: 800; line-height: 1.3; text-align: center; pointer-events: none; opacity: 0; transition: opacity .25s; z-index: 2; }
.m3d-toast.is-on { opacity: 1; animation: m3d-toast-in .3s cubic-bezier(.2,1.5,.4,1); }
@keyframes m3d-toast-in { from { transform: translate(-50%, -50%) scale(0.8); } }
.m3d-loading { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 99px; background: rgba(6,10,30,0.5); font-size: 13px; font-weight: 800; pointer-events: none; white-space: nowrap; }
.m3d-loading i { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,0.35); border-top-color: #fff; animation: m3d-spin .8s linear infinite; }
@keyframes m3d-spin { to { transform: rotate(360deg); } }
.m3d-nogl { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: #0b1328; color: #dfe9ff; text-align: center; z-index: 5; }

/* ---------- dialogs ---------- */
.m3d-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(6,10,30,0.5); z-index: 3; }
.m3d-overlay.is-solid { background: rgba(8,12,31,0.97); }
.m3d-panel { position: relative; width: min(100%, 420px); max-height: 100%; overflow: auto; overscroll-behavior: contain; text-align: center; padding: 20px 16px 16px; border-radius: 20px; background: #fff; color: #1b2550;
  box-shadow: 0 8px 0 rgba(6,10,30,0.2), 0 20px 50px rgba(6,10,30,0.4); animation: m3d-in .28s cubic-bezier(.2,1.3,.4,1); outline: none; }
.m3d-panel.is-wide { width: min(100%, 560px); }
@keyframes m3d-in { from { opacity: 0; transform: scale(0.92) translateY(10px); } }
.m3d-coach { animation-name: m3d-coach-in; }
@keyframes m3d-coach-in { from { opacity: 0; transform: translateX(-50%) translateY(12px); } }
.m3d-panel h3 { margin: 0 0 4px; font-size: 23px; font-weight: 900; line-height: 1.15; }
.m3d-kicker { margin: 0 0 2px; font-size: 12px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: #6b7699; }
.m3d-panel p { margin: 6px 0; font-size: 15px; line-height: 1.45; }
.m3d-panel .m3d-note { font-size: 13px; color: #5a6690; }
.m3d-bigstars { display: flex; justify-content: center; gap: 6px; margin: 8px 0 4px; }
.m3d-bigstars svg { width: 46px; height: 46px; stroke: none; fill: #e3e7f2; }
.m3d-bigstars svg.is-on { fill: #ffbe1a; filter: drop-shadow(0 3px 0 #c9861e); animation: m3d-star .45s cubic-bezier(.2,1.6,.4,1) both; }
.m3d-bigstars svg.is-on:nth-child(2) { animation-delay: .22s; } .m3d-bigstars svg.is-on:nth-child(3) { animation-delay: .44s; }
@keyframes m3d-star { from { transform: scale(0) rotate(-40deg); opacity: 0; } }
.m3d-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; margin: 10px 0 4px; }
.m3d-rows div { display: flex; flex-direction: column; padding: 7px 4px; border-radius: 12px; background: #eef1f8; line-height: 1.15; }
.m3d-rows small { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7699; }
.m3d-rows b { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }
.m3d-rows .is-new b { color: #d9480f; }
.m3d-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.m3d-btn { flex: 1 1 120px; min-height: 46px; padding: 8px 14px; border: 0; border-radius: 14px; background: #eef1f8; color: #1b2550; font-size: 15px; font-weight: 900; cursor: pointer; box-shadow: 0 3px 0 #cdd5e6; transition: transform .1s, box-shadow .1s; }
.m3d-btn:hover { transform: translateY(-1px); } .m3d-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #cdd5e6; }
.m3d-btn.is-main { flex-basis: 100%; min-height: 52px; background: #ffd166; color: #3a2500; font-size: 17px; box-shadow: 0 4px 0 #c9861e; }
.m3d-btn.is-main:active { box-shadow: 0 1px 0 #c9861e; }
.m3d-btn:focus-visible, .m3d-lvb:focus-visible, .m3d-close:focus-visible, .m3d-ptog:focus-visible { outline: 3px solid #2f6fd0; outline-offset: 2px; }
.m3d-panel.has-head { padding-top: 0; scroll-padding-top: 84px; }
.m3d-head { position: sticky; top: 0; z-index: 2; margin: 0 -16px 6px; padding: 20px 16px 6px; background: #fff; box-shadow: 0 6px 8px -7px rgba(6,10,30,0.22); }
.m3d-close { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; color: #5a6690; cursor: pointer; }
.m3d-close svg { width: 20px; height: 20px; stroke-width: 3; }
.m3d-close:hover { background: #eef1f8; }
.m3d-ptogs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.m3d-ptog { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 4px 14px; border: 0; border-radius: 99px; background: #1b2550; color: #fff; font-size: 13px; font-weight: 800; cursor: pointer; }
.m3d-ptog[aria-pressed="false"] { background: #d9deeb; color: #4a557a; }
.m3d-ptog i { width: 10px; height: 10px; border-radius: 50%; background: #6dff8f; } .m3d-ptog[aria-pressed="false"] i { background: #9aa3bd; }

/* how to play */
.m3d-how { text-align: left; }
.m3d-how ol, .m3d-how ul { margin: 8px 0; padding-left: 20px; font-size: 15px; line-height: 1.45; }
.m3d-how li { margin: 5px 0; }
.m3d-how kbd { display: inline-block; min-width: 1.5em; padding: 0 5px; border-radius: 6px; background: #e3e7f2; font: inherit; font-size: 13px; font-weight: 800; text-align: center; }
.m3d-rule { display: flex; align-items: center; gap: 12px; margin: 10px 0; padding: 10px 12px; border-radius: 14px; background: #eef6ff; font-size: 14px; line-height: 1.4; }
.m3d-rule svg { flex: 0 0 auto; width: 132px; height: 62px; stroke-width: 1.6; }
.m3d-how .hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .m3d-how .hint-kb { display: none; } .m3d-how .hint-touch { display: inline; } }

/* level map */
.m3d-map-total { margin: 0 0 8px; font-size: 14px; font-weight: 800; color: #5a6690; }
.m3d-ch { margin: 12px 0 0; text-align: left; }
.m3d-ch h4 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 6px; font-size: 15px; font-weight: 900; }
.m3d-ch h4 small { font-size: 12px; font-weight: 800; color: #6b7699; white-space: nowrap; }
.m3d-ch h4 i { display: inline-block; width: 12px; height: 12px; margin-right: 7px; border-radius: 4px; vertical-align: -1px; }
.m3d-lvs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.m3d-lvb { min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px; border: 0; border-radius: 12px; background: #eef1f8; color: #1b2550; font-size: 16px; font-weight: 900; cursor: pointer; box-shadow: 0 3px 0 #cdd5e6; }
.m3d-lvb .m3d-stars { display: inline-flex; gap: 0; } .m3d-lvb svg { width: 12px; height: 12px; stroke: none; fill: #c9d0e2; } .m3d-lvb svg.is-on { fill: #ffb400; }
.m3d-lvb.is-cur { background: #ffd166; box-shadow: 0 3px 0 #c9861e; }
.m3d-lvb.is-cur svg:not(.is-on) { fill: rgba(58,37,0,0.25); }
.m3d-lvb:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.m3d-lvb .m3d-lock { width: 14px; height: 14px; fill: none; stroke: #6b7699; stroke-width: 2.4; }

/* ---------- full screen ---------- */
.stage.is-immersive .stage-body > .m3d { min-height: 0; flex: 1 1 auto; }
.stage.is-immersive .m3d-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; max-height: none; min-height: 0; border-radius: 0; }

/* short stages (a phone on its side): tighter rows so the shape keeps its room */
@media (max-width: 480px) { .m3d-held span { display: none; } .m3d-held { padding-right: 3px; } }
/* wide stages: the shape on the left, title and menu in a column on the right (classes set by layout() in main.js) */
.m3d-stage.is-wide .m3d-title { align-items: flex-end; justify-content: center; gap: 14px; padding: 12px clamp(14px, 4.5%, 72px) 12px 14px; }
.m3d-stage.is-wide .m3d-titletop, .m3d-stage.is-wide .m3d-menu { width: 372px; max-width: 46%; }
.m3d-stage.is-wide .m3d-logo { font-size: clamp(34px, 9vmin, 60px); }
.m3d-stage.is-short .m3d-title { gap: 6px; padding-top: 8px; padding-bottom: 8px; }
.m3d-stage.is-short .m3d-logo { flex-direction: row; gap: 0.25em; font-size: 30px; }
.m3d-stage.is-short .m3d-prog { margin-top: 4px; font-size: 13px; }
.m3d-stage.is-short .m3d-menu { gap: 6px; }
.m3d-stage.is-short .m3d-go { min-height: 52px; } .m3d-stage.is-short .m3d-mbtn { min-height: 42px; }
.m3d-stage.is-short .m3d-tbtn { min-height: 46px; flex-direction: row; gap: 6px; }
.m3d-stage.is-short .m3d-coach { bottom: calc(max(10px, env(safe-area-inset-bottom, 0px)) + 56px); padding: 8px 12px 2px; }
@media (prefers-reduced-motion: reduce) {
  .m3d-logo, .m3d-panel, .m3d-coach, .m3d-toast.is-on, .m3d-bigstars svg.is-on, .m3d-stat.is-low, .m3d-stat.is-gain b, .m3d-combo.is-bump { animation: none; }
  .m3d-pop { animation-duration: 0.9s; animation-name: m3d-pop-calm; }
  @keyframes m3d-pop-calm { 0% { opacity: 0; } 15% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
}
