/* QR Arcade 1.1.0 — ThinkClouds — Proprietary */
.qra {
  --qra-accent: #FFE600;
  --qra-max: 560px;
  --qra-w: 224px;
  position: relative;
  max-width: var(--qra-max);
  margin: 0 auto;
  padding: 10px 0 12px;
  background: #000;
  color: #fff;
  font: 600 12px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.qra *, .qra *::before, .qra *::after { box-sizing: border-box; }
.qra:focus-visible { box-shadow: 0 0 0 2px var(--qra-accent); }
.qra [hidden] { display: none !important; }

.qra-stage { position: relative; width: var(--qra-w); margin: 0 auto; }
.qra-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  background: #000;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: manipulation;
  cursor: pointer;
}

.qra .qra-cta {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translateX(-50%);
  padding: .7em 1.2em;
  border: 2px solid var(--qra-accent);
  background: #000;
  color: var(--qra-accent);
  font: inherit;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--qra-accent);
}
.qra .qra-cta:hover, .qra .qra-cta:focus-visible { background: var(--qra-accent); color: #000; outline: none; }

.qra-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: var(--qra-w);
  max-width: 100%;
  margin: 8px auto 0;
}
.qra-hint { color: #8c8c8c; font-size: 11px; font-weight: 500; min-width: 0; }
.qra-btns { display: inline-flex; gap: 6px; margin-left: auto; }
.qra .qra-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid #333;
  border-radius: 6px;
  background: #000;
  color: #fff;
  box-shadow: none;
  line-height: 1;
  cursor: pointer;
}
.qra .qra-btn:hover, .qra .qra-btn:focus-visible { border-color: var(--qra-accent); color: var(--qra-accent); outline: none; }
.qra .qra-btn svg { width: 18px; height: 18px; display: block; }

/* comandi touch */
.qra-touch {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: var(--qra-w);
  max-width: 100%;
  margin: 12px auto 0;
  touch-action: none;
}
.qra--touch .qra-touch { display: flex; }
.qra--touch .qra-hint { display: none; }

.qra-pad {
  display: flex;
  flex: 0 1 200px;
  height: 76px;
  border: 2px solid #3a3a3a;
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
}
.qra-pad .qra-dir { flex: 1; display: grid; place-items: center; color: #fff; }
.qra-pad .qra-dir + .qra-dir { border-left: 2px solid #3a3a3a; }

.qra-cross {
  position: relative;
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 2px solid #3a3a3a;
  touch-action: none;
}
.qra-cross .qra-dir {
  position: absolute;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 8px;
}
.qra-cross .qra-dir-up { left: 42px; top: 2px; }
.qra-cross .qra-dir-down { left: 42px; bottom: 2px; }
.qra-cross .qra-dir-left { left: 2px; top: 42px; }
.qra-cross .qra-dir-right { right: 2px; top: 42px; }
.qra .qra-dir svg { width: 30px; height: 30px; display: block; pointer-events: none; }
.qra .qra-dir.is-on { background: var(--qra-accent); color: #000; }

.qra-buttons { display: flex; gap: 10px; flex: 0 1 auto; }
.qra .qra-act {
  appearance: none;
  -webkit-appearance: none;
  min-width: 96px;
  height: 76px;
  margin: 0;
  padding: 0 10px;
  border: 2px solid var(--qra-accent);
  border-radius: 12px;
  background: #000;
  color: var(--qra-accent);
  font: inherit;
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  box-shadow: none;
  touch-action: none;
  cursor: pointer;
}
.qra .qra-act-b { border-color: #FF8A1F; color: #FF8A1F; }
.qra .qra-act.is-on { background: var(--qra-accent); color: #000; }
.qra .qra-act-b.is-on { background: #FF8A1F; color: #000; }
.qra-touch--cross .qra-buttons { flex-direction: column; }
.qra-touch--cross .qra-act { height: 58px; min-width: 112px; }

/* schermo intero (nativo o simulato, es. iPhone) */
.qra.qra--full {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  max-width: none;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}
.qra.qra--full:focus-visible { box-shadow: none; }
.qra--full.qra--land .qra-touch {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: auto;
  margin: 0;
  padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  pointer-events: none;
}
.qra--full.qra--land .qra-touch > * { pointer-events: auto; }
.qra--full.qra--land .qra-pad { flex-basis: 140px; }
html.qra-lock, html.qra-lock body { overflow: hidden !important; }
