/* Host integration only. Frozen09's geometry/material/typography CSS is intact. */
/* candidate227 (USER227-06): a prompt band the host hides (loading) stays hidden. */
body.menu-local #custom-menu footer:not([hidden]) { display:flex!important; }
/* candidate230 (review R230-24): a pause panel whose only prompt is Confirm (error, match ready,
   left) has nothing to show for mouse or touch, where Confirm is dropped; no empty band. */
body.menu-local #custom-menu[data-input="touch"] .mm-pause footer:has(> .mm-prompt--back[hidden]) { display:none!important; }
#menu-tools,#menu-show-tools { display:none!important; }
#custom-pause { position:absolute;right:12px;top:12px;z-index:20;min-height:44px; }
#custom-pause[hidden] { display:none; }
/* candidate230 (fonts): the in-game "Menu / Controls" key is the one host button
   players see during a match. It used the infrastructure console's type (Inter /
   Segoe UI via style.css); it now uses the menu's UI type and utility-tab steel. */
#custom-pause { padding:0 16px;border:1px solid rgb(170 186 214 / .55);border-radius:3px;color:#dbe4f5;background:linear-gradient(180deg,rgb(64 78 110 / .92),rgb(22 30 52 / .94));box-shadow:inset 0 1px 0 rgb(255 255 255 / .14),0 1px 0 rgb(2 4 12 / .8);font:600 clamp(12px,1.1vw,19px) "MM UI";font-stretch:82%;letter-spacing:.06em;text-transform:uppercase;text-shadow:0 1px 0 rgb(0 0 0 / .6); }
#custom-pause:hover { filter:brightness(1.12); }
#custom-pause:focus-visible { outline:2px solid #ffad1f;outline-offset:3px; }
#custom-menu .mm-utility { position:absolute;z-index:3;top:max(8px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));display:flex;gap:14px; }
#custom-menu:has(.mm-main:not([hidden])) > .mm-utility { top:env(safe-area-inset-top,0px);right:env(safe-area-inset-right,0px); }
#custom-menu .mm-meter[hidden] { display:none; }
#custom-menu .mm-utility .mm-prompt { position:static;font-size:clamp(12px,1.1vw,19px);color:#dbe4f5;min-height:28px; }
#custom-menu .mm-live-feedback { position:absolute;z-index:3;left:2%;bottom:1%;max-width:58%;margin:0;color:#dbe4f5;font:italic clamp(11px,1.1vw,19px) "MM UI";pointer-events:none; }
#custom-menu .mm-live-feedback:empty { display:none; }
/* candidate227 (USER227-04/05): the Controls panel's rows, select and keys are
   laid out and styled in custom-menu.css (.mm-controls-body / .mm-set). */
#custom-menu .mm-utility :focus-visible { outline:2px solid #ffad1f;outline-offset:3px; }
#custom-menu .mm-row:not(:has([data-has-art])) .mm-portrait,#custom-menu .mm-rrow:not(:has([data-has-art])) .mm-portrait { visibility:hidden; }
/* Fighter color (candidate227, USER227-01): the Color action sits below Ready,
   between the P1 card and prompts. Scale with the stage; include the focus glow clearance. */
#custom-menu .mm-colors { --x:700;--y:962;--w:1080;--h:52;display:flex;gap:calc(22 * var(--u));align-items:center; }
#custom-menu .mm-colors .mm-prompt { height:100%;padding:0 calc(16 * var(--u));font:600 max(12px,calc(28 * var(--u))) "MM UI";white-space:nowrap;font-stretch:var(--mm-ui-stretch); }
/* The selected name lives inside Color's steel face. Keep its width stable
   while cycling so repeated clicks can land at the same point. */
#custom-menu .mm-colors .mm-prompt[data-color="change"] { inline-size:7em;justify-content:center;text-align:center;height:auto;padding:calc((52 * var(--u) - max(12px,28 * var(--u))) / 2) calc(16 * var(--u));line-height:1;white-space:normal;text-wrap:balance;overflow-wrap:anywhere; }

/* Live picked-stage state persists while focus moves to YOU/CPU/Start.
   A picked stage is not a second navigation cursor. Keep Claude131's glove
   geometry; only current keyboard/controller focus may reveal it (candidate227:
   with a mouse the hand is the cursor itself). */
#custom-menu .mm-thumb-slot:has(> .mm-act[data-selected]:not(:focus))::after { opacity:0; }
/* full-multiplayer01 (functional, no restyle): the Practice screen reused as the online
   room map step. The room variant hides the CPU/level parts and fits the 29 original
   stage-select entries (6 x 5) into the same 892 x 466 grid box. */
#custom-menu .mm-practice[data-variant="room"] :is(.mm-slot--cpu,.mm-setup__vs,.mm-levelctl,.mm-setup__zone--cpu,.mm-setup__zone--level) { visibility:hidden; }
#custom-menu .mm-practice[data-variant="room"] .mm-thumbs { grid-template-columns:repeat(6,calc(133 * var(--u)));grid-auto-rows:calc(83 * var(--u));gap:calc(12 * var(--u)); }
#custom-menu .mm-practice[data-variant="room"] .mm-thumb-slot { --tx:98;--ty:44;--hw:50; }
/* stage-summary-layout01 (review672 F1): GANONDORF was cut at the YOU zone's slanted edge. The 460 slot
   (x 55-515) left the name ~203 after its label, portrait and 22 gaps, under review112's 230 box, and the
   44 first-line floor needs ~250 for that word. In the room variant the slot starts at the zone's inner
   left edge (x 24, so the label sits at the zone's chamfer corner x 40; right edge 515 unchanged), giving
   the name its full 230, and the host's --fs-first (custom-ui.mjs roomStage) lowers the first line only
   for a first word longer than that. Same faces, gaps, 34 costume line, wrapping and zone; Practice unchanged. */
#custom-menu .mm-practice[data-variant="room"] .mm-slot--you { left:calc(24 * var(--u));width:calc(491 * var(--u)); }
#custom-menu .mm-practice[data-variant="room"] .mm-slot--you .mm-slot__name::first-line { font-size:max(calc(var(--fs-first,44) * var(--u)),1em); }

/* The full roster adds Zelda/Sheik start choice beside Change color. The bar
   uses the available width below Ready while retaining its height and position. */

/* The cog keeps its hit target, without the utility-tab enclosure. */
#custom-menu .mm-utility .mm-settings-trigger,
#custom-pause.mm-settings-trigger { width:44px;min-width:44px;min-height:44px;padding:0;border:0;border-radius:0;background:none;box-shadow:none; }
/* Title screens: align with the title centre, safely below its upper rail. */
#custom-menu:has(.mm-screen:not([hidden]):not(.mm-main)) .mm-utility {
  --utility-u:min(calc((100cqw - var(--mm-safe-l) - var(--mm-safe-r)) / 1920),calc((100cqh - var(--mm-safe-t) - var(--mm-safe-b)) / 1080));
  top:calc(50cqh + (var(--mm-safe-t) - var(--mm-safe-b)) / 2 - 540 * var(--utility-u) + max(68 * var(--utility-u),34 * var(--utility-u) + 20px) - 22px);
}

/* Keep the 44px Settings target. The cog itself carries the menu focus state. */
#custom-menu .mm-utility .mm-settings-trigger,
#custom-pause.mm-settings-trigger { height:44px;border-radius:50%; }
#custom-menu:is([data-input="pointer"],[data-input="touch"]) .mm-settings-trigger:focus { outline:none; }
#custom-menu .mm-utility .mm-settings-trigger:focus { outline:none; }
#custom-menu .mm-utility .mm-settings-trigger:focus-visible .mm-cog,
#custom-menu[data-input="gamepad"] .mm-utility .mm-settings-trigger:focus .mm-cog {
  stroke:#ffc540;
  stroke-width:2.6;
}
@media (forced-colors: active) {
  #custom-menu .mm-utility .mm-settings-trigger:focus-visible .mm-cog,
  #custom-menu[data-input="gamepad"] .mm-utility .mm-settings-trigger:focus .mm-cog {
    forced-color-adjust:none;
    fill:Canvas;
    stroke:Highlight;
  }
}
/* Prompt shape follows the selected binding, not a incidental mouse move.
   Numerals identify actual Standard Gamepad positions; full names stay accessible. */
#custom-menu[data-binding-kind="gamepad"]:not([data-input="touch"]) .mm-glyph { padding:0;border-radius:50%;font-size:max(var(--mm-min-fs),calc(27 * var(--u))); }
/* Re-layering Settings on fullscreen changes is not another panel entrance. */
#custom-menu .mm-settings[data-display-transition] .mm-pausepanel { animation:none; }

/* Keep Fourside's saucer visible in the wide online map tile. */
#custom-menu .mm-practice[data-variant="room"] .mm-thumb[data-value="18"] .mm-thumb__art { background-position: center top; }

/* viewport-repair01: the fixed root still clips the decorative overhang
   (.mm-stage::before, Ready streaks) but is no scroll container, so a focus
   or scrollIntoView can no longer move the stage inside it. */
#custom-menu { overflow:clip; }
