/* Mario's A and B touch buttons, the first-match ghost stick and the controls card
   (client/mario-touch.mjs, client/first-match.mjs). Z, ↻ and the camera tap target stay in activity.css.
   Right thumb zone: A low, B up and to its left, clear of Z and the camera icon. */
.mario-touch-jump,.mario-touch-attack,.mario-ghost-stick{display:none}
.discord-mobile #touch.mario-touch .mario-touch-jump,.discord-mobile #touch.mario-touch .mario-touch-attack{
  display:block;position:absolute;width:76px;height:76px;padding:0;border-radius:50%;
  border:1.5px solid #ffffff8c;color:#fff;font:700 28px/1 Arial,sans-serif;text-shadow:0 1px 2px #0008;
  background:#1d4f9acc;box-shadow:0 2px 6px #0006;touch-action:none;-webkit-tap-highlight-color:transparent;
  backdrop-filter:blur(4px);transition:transform 60ms ease-out,background-color 60ms ease-out}
.discord-mobile #touch.mario-touch .mario-touch-jump{right:calc(108px + env(safe-area-inset-right));bottom:calc(24px + env(safe-area-inset-bottom))}
.discord-mobile #touch.mario-touch .mario-touch-attack{width:68px;height:68px;font-size:25px;background:#2a8a4acc;
  right:calc(196px + env(safe-area-inset-right));bottom:calc(84px + env(safe-area-inset-bottom))}
.discord-mobile #touch.mario-touch :is(.mario-touch-jump,.mario-touch-attack,.mario-touch-crouch).pressed{
  transform:scale(.92);border-color:#fff;background-color:#ffffffa6;color:#0b1a2e;text-shadow:none}
/* Portrait: the right half is narrow, so B sits above A instead of beside it. */
@media (orientation:portrait){
  .discord-mobile #touch.mario-touch .mario-touch-jump{right:calc(100px + env(safe-area-inset-right));bottom:calc(30px + env(safe-area-inset-bottom))}
  .discord-mobile #touch.mario-touch .mario-touch-attack{right:calc(112px + env(safe-area-inset-right));bottom:calc(122px + env(safe-area-inset-bottom))}
}

.discord-mobile #touch.mario-touch.mario-first-match .mario-ghost-stick{
  display:block;position:absolute;left:max(64px,14vw);bottom:calc(42px + env(safe-area-inset-bottom));
  width:116px;height:116px;border:1px dashed #ffffff4d;border-radius:50%;background:#15344422;pointer-events:none}
.mario-ghost-stick span{position:absolute;left:34px;top:34px;width:48px;height:48px;border-radius:50%;
  border:2px solid #ffffff59;background:#ffffff1a;animation:mario-ghost-drag 1.8s ease-in-out infinite}
@keyframes mario-ghost-drag{0%,20%{transform:none}55%,75%{transform:translateY(-34px)}100%{transform:none}}
@media (orientation:portrait){
  .discord-mobile #touch.mario-touch.mario-first-match .mario-ghost-stick{left:max(40px,10vw);bottom:calc(170px + env(safe-area-inset-bottom))}
}
/* The real stick replaces the ghost while a thumb drags. */
.discord-mobile #touch.mario-touch .mario-move-stick:not([hidden]) ~ .mario-ghost-stick{display:none}
@media (prefers-reduced-motion:reduce){.mario-ghost-stick span{animation:none;transform:translateY(-20px)}}

/* Below #match-notice (wave and round titles at 12% from the top). */
#controls-card{position:fixed;z-index:25;top:max(27%,calc(env(safe-area-inset-top) + 100px));left:50%;transform:translateX(-50%);
  display:flex;flex-wrap:wrap;justify-content:center;gap:10px 22px;width:max-content;max-width:calc(100vw - 32px);box-sizing:border-box;
  margin:0;padding:14px 22px;color:#fff;font:20px/1.2 Arial,sans-serif;text-shadow:0 1px 2px #000;
  background:#061631e0;border:1px solid #2896ff;pointer-events:none;animation:controls-card-in .2s ease-out}
#controls-card p{display:flex;align-items:center;gap:10px;margin:0;white-space:nowrap}
#controls-card kbd{min-width:28px;padding:4px 8px;box-sizing:border-box;text-align:center;font:700 16px/1.2 Arial,sans-serif;
  color:#dce7ed;border:1px solid #7f9fbb;border-radius:4px;background:#ffffff14}
#controls-card[data-device="touch"] p:nth-child(2) kbd,#controls-card[data-device="touch"] p:nth-child(3) kbd{
  width:36px;height:36px;padding:0;border-radius:50%;line-height:34px;font-size:18px;color:#fff;border-color:#ffffff8c}
#controls-card[data-device="touch"] p:nth-child(2) kbd{background:#1d4f9a}
#controls-card[data-device="touch"] p:nth-child(3) kbd{background:#2a8a4a}
#controls-card.leaving{opacity:0;transition:opacity .25s ease-out}
@keyframes controls-card-in{from{opacity:0}}
@media (prefers-reduced-motion:reduce){#controls-card{animation:none}#controls-card.leaving{transition:none}}
@media (orientation:portrait) and (max-width:520px){#controls-card{flex-direction:column;align-items:flex-start;gap:10px;font-size:18px}}
