/* Emberforge / forge — przyciski dotykowe trybu pracy (moduł forge/interact). Mobile-first; tylko zmienne --ef-* z kontraktu.
   Widoczne wyłącznie na urządzeniu dotykowym w trybie pracy (element jest `hidden` poza nim). */

.efg-touch {
  --efg-safe-r: var(--ef-safe-right, env(safe-area-inset-right, 0px));
  --efg-safe-b: var(--ef-safe-bottom, env(safe-area-inset-bottom, 0px));
  --efg-safe-t: var(--ef-safe-top, env(safe-area-inset-top, 0px));
  position: absolute;
  inset: 0;
  z-index: calc(var(--ef-z-hud, 10) + 3);
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.efg-touch[hidden] { display: none; }
.efg-touch * { box-sizing: border-box; }

/* przeciąganie ręki: prawa część ekranu (pod przyciskami) */
.efg-pad {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 64%;
  z-index: 1;
  pointer-events: auto;
  touch-action: none;
}
.efg-pad[hidden] { display: none; }
/* celownik ręki nie jest rysowany w DOM — kursor widać jako ducha ręki w scenie */

.efg-btn {
  position: absolute;
  z-index: 2;
  pointer-events: auto;
  touch-action: manipulation;
  min-width: 56px;
  min-height: 56px;
  padding: 0 12px;
  border-radius: 28px;
  border: 2px solid color-mix(in srgb, var(--ef-gold, #ffcf5a) 45%, transparent);
  background: color-mix(in srgb, var(--ef-panel, #2a1d14) 78%, transparent);
  color: var(--ef-ink, #f6e7cf);
  font: 700 0.82rem/1.1 var(--ef-font, system-ui, sans-serif);
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  cursor: pointer;
}
.efg-btn span { pointer-events: none; }
.efg-btn.is-on,
.efg-btn:active {
  background: color-mix(in srgb, var(--ef-ember, #ff7a2e) 70%, var(--ef-panel, #2a1d14));
  border-color: var(--ef-gold, #ffcf5a);
  color: #fff;
}
.efg-btn:focus-visible { outline: 3px solid var(--ef-gold, #ffcf5a); outline-offset: 2px; }

/* układ: duże przyciski akcji w prawym dolnym rogu (pod kciukiem), pomocnicze u góry po prawej */
.efg-btn--use  { right: calc(var(--efg-safe-r) + 16px);  bottom: calc(var(--efg-safe-b) + 24px);  width: 92px; height: 92px; border-radius: 50%; font-size: 0.95rem; }
.efg-btn--grab { right: calc(var(--efg-safe-r) + 124px); bottom: calc(var(--efg-safe-b) + 40px);  width: 84px; height: 84px; border-radius: 50%; }
.efg-btn--flip { right: calc(var(--efg-safe-r) + 20px);  bottom: calc(var(--efg-safe-b) + 128px); width: 64px; height: 64px; border-radius: 50%; font-size: 0.74rem; }
.efg-btn--mode { right: calc(var(--efg-safe-r) + 12px);  top: calc(var(--efg-safe-t) + 70px);    min-width: 76px; }
.efg-btn--skip { right: calc(var(--efg-safe-r) + 12px);  top: calc(var(--efg-safe-t) + 130px);   min-width: 76px; opacity: 0.9; }

/* telefon w poziomie (niska wysokość): ciaśniej, ale nadal ≥ 44 px */
@media (max-height: 460px) {
  .efg-btn--use  { width: 76px; height: 76px; bottom: calc(var(--efg-safe-b) + 12px); }
  .efg-btn--grab { width: 68px; height: 68px; right: calc(var(--efg-safe-r) + 100px); bottom: calc(var(--efg-safe-b) + 20px); }
  .efg-btn--flip { width: 52px; height: 52px; bottom: calc(var(--efg-safe-b) + 98px); }
  .efg-btn--mode { top: calc(var(--efg-safe-t) + 8px); min-height: 48px; }
  .efg-btn--skip { top: calc(var(--efg-safe-t) + 62px); min-height: 48px; }
}
@media (min-width: 900px) {
  .efg-btn { font-size: 0.95rem; }
}
@media (prefers-reduced-motion: reduce) {
  .efg-btn { transition: none; }
}
