/* Coletor.io — estilos específicos (HUD usa tokens; arena tem canvas próprio) */
.io-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: clamp(0.7rem, 2.5vw, 1.1rem);
}

.io-stage {
  position: relative;
  width: 100%;
  height: clamp(360px, 62vh, 600px);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #0d0d24;
  box-shadow: inset 0 0 0 1px var(--border);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}
.io-stage.shake {
  animation: io-shake 0.28s var(--ease);
}
@keyframes io-shake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-3px, 2px);
  }
  50% {
    transform: translate(3px, -2px);
  }
  75% {
    transform: translate(-2px, -2px);
  }
}
#canvas {
  position: absolute;
  inset: 0;
}

/* Barra superior: vida + onda */
.io-hud-top {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  right: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: space-between;
  pointer-events: none;
}
.io-hp {
  flex: 0 1 auto;
  width: min(46%, 230px);
  height: 20px;
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--r-full);
}
.io-hp__fill {
  position: absolute;
  inset: 0;
  width: 100%;
  background: linear-gradient(90deg, #16a34a, #86efac);
  transition: width 0.12s linear;
}
.io-hp span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-xs);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.io-wave-banner {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.25em 0.75em;
  border-radius: var(--r-full);
  white-space: nowrap;
}

/* Recursos coletados (canto inferior esquerdo) */
.io-res {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  display: flex;
  gap: 0.4rem;
  pointer-events: none;
  flex-wrap: wrap;
}
.io-res__item {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--r-full);
  padding: 0.2em 0.6em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-sm);
}

/* Joystick virtual (aparece no toque) */
.io-joystick {
  position: absolute;
  width: 110px;
  height: 110px;
  margin: -55px 0 0 -55px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: none;
  pointer-events: none;
}
.io-joystick.show {
  display: block;
}
.io-joystick__knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50px;
  height: 50px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(236, 72, 153, 0.72);
  border: 2px solid #fff;
}

/* Barra de construção */
.io-build {
  display: flex;
  gap: var(--sp-3);
}
.io-build__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15em;
  padding: 0.55em 0.6em;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 2px solid var(--border);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--dur-fast) var(--ease),
    border-color var(--dur) ease,
    box-shadow var(--dur) ease;
}
.io-build__btn small {
  color: var(--text-mute);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-xs);
}
.io-build__btn kbd {
  font-family: var(--font-body);
  font-size: 0.7em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 0.4em;
  color: var(--text-soft);
}
.io-build__btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.io-build__btn:active {
  transform: translateY(0) scale(0.98);
}
.io-build__btn.affordable {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent);
}

.io-hint {
  text-align: center;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.io-hint b {
  color: var(--brand);
}

@media (max-width: 420px) {
  .io-res__item {
    font-size: var(--fs-xs);
    padding: 0.15em 0.5em;
  }
  .io-wave-banner {
    font-size: var(--fs-xs);
  }
}
